Skip to content

Guard Google login and conditionally provide OAuth#258

Open
SaintSampo wants to merge 2 commits into
mainfrom
GoogleAuthFallback
Open

Guard Google login and conditionally provide OAuth#258
SaintSampo wants to merge 2 commits into
mainfrom
GoogleAuthFallback

Conversation

@SaintSampo

Copy link
Copy Markdown
Collaborator

Add an error boundary in src/components/folder-tree.tsx and wrap the Login component to avoid crashes if the Google auth widget errors at render time.

Render the IDE instead of blocking on the OAuth client ID fetch, which left
the page stuck on "Loading Google authentication..." whenever GOOGLE_AUTH_URL
was unset or the auth backend was unreachable.

Skip the Google login button when no auth backend is configured: mounting
useGoogleLogin with an empty client ID throws and takes down the file tree
panel that hosts the widget.
@SaintSampo
SaintSampo force-pushed the GoogleAuthFallback branch from 83a6ba4 to ebc390b Compare July 22, 2026 16:01
@SaintSampo
SaintSampo requested a review from kcq888 July 22, 2026 16:05
@SaintSampo

Copy link
Copy Markdown
Collaborator Author

This morning we discussed how recent changes by Frank might impact this PR. I just went through and updated this branch so it is consistent with Main. I tested the feature this PR adds and everything looks good.

Replace static environment variable check with a React Context that holds the OAuth client ID fetched from the auth backend at runtime. This allows the Login component to wait until the client ID is actually available before rendering, rather than relying on build-time configuration. The component will render the login button only when the ID has been successfully fetched, preventing errors from Google's GSI client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant