File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 3737
38381 . Go to: https://console.cloud.google.com/apis/credentials
39392 . Click on your ** OAuth 2.0 Client ID**
40- 3 . Under ** Authorized redirect URIs** , add:
40+ 3 . Under ** Authorized redirect URIs** , add ** ALL of these ** :
4141 ```
4242 https://banyhroaktppyqtspznt.supabase.co/auth/v1/callback
43+ http://localhost:8080
44+ http://localhost:3000
4345 ```
44- 4 . Click ** Save**
46+ 4 . Under ** Authorized JavaScript origins** , add:
47+ ```
48+ http://localhost:8080
49+ https://bb84-simulation.vercel.app
50+ ```
51+ 5 . Click ** Save**
52+ 6 . ** Wait 5-10 minutes** for Google to propagate the changes
4553
46- ✅ This allows Google OAuth to redirect back to your app.
54+ ✅ This allows Google OAuth to redirect back to your app on the correct port .
4755
4856---
4957
Original file line number Diff line number Diff line change @@ -28,10 +28,16 @@ export interface LeaderboardEntry {
2828
2929// Auth helper functions
3030export const signInWithGoogle = async ( ) => {
31+ // Determine the correct redirect URL based on environment
32+ const isDev = window . location . hostname === 'localhost' ;
33+ const redirectTo = isDev
34+ ? 'http://localhost:8080/#/quiz'
35+ : 'https://bb84-simulation.vercel.app/#/quiz' ;
36+
3137 const { data, error } = await supabase . auth . signInWithOAuth ( {
3238 provider : 'google' ,
3339 options : {
34- redirectTo : ` ${ window . location . origin } /#/quiz` ,
40+ redirectTo,
3541 } ,
3642 } ) ;
3743 return { data, error } ;
You can’t perform that action at this time.
0 commit comments