-
Notifications
You must be signed in to change notification settings - Fork 469
Open
Labels
bugSomething isn't workingSomething isn't workingfront-endIssue related to the React Front End DashboardIssue related to the React Front End Dashboard
Description
Bug Description
Users encounter a TypeError when attempting to sign in with Google on slow connections. The OAuth client is not ready when the user clicks the button.
Error:
TypeError: Cannot read properties of undefined (reading 'requestAccessToken')
Sentry Issue: https://flagsmith.sentry.io/issues/FLAGSMITH-FRONTEND-462
Priority: Low
This is not critical because:
- Only affects users on slow network connections
- Does not break the page or block other functionality
- Users can retry and the button will work once the SDK loads
- Email/password and other login methods remain functional
Impact
- 42 users affected
- 115 events since first seen (2025-04-28)
- Affects Google authentication on slow connections only
Steps to Reproduce
- Open Chrome DevTools → Network tab
- Set throttling to Slow 3G
- Navigate to https://app.flagsmith.com/
- Click the Google button before the page fully loads
- Error occurs in console
Root Cause
In GoogleButton.tsx:27, the login() function is called without checking if the Google OAuth client is ready:
onClick={() => login()}On slow connections, the Google SDK hasn't initialised clientRef.current yet.
Suggested Fix
Disable the button until the OAuth client is ready:
const { login, ready } = useGoogleLogin({ ... })
<Button
disabled={!ready}
onClick={() => login()}
>
Google
</Button>Files to Modify
frontend/web/components/GoogleButton.tsx
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfront-endIssue related to the React Front End DashboardIssue related to the React Front End Dashboard