Skip to content

Commit 3bf57cd

Browse files
committed
Update OAuth redirect to use Vercel URL in production
1 parent 6bce880 commit 3bf57cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/supabase.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ export interface LeaderboardEntry {
2222

2323
// Auth helper functions
2424
export const signInWithGoogle = async () => {
25+
// Use Vercel URL in production, localhost in development
26+
const redirectUrl = window.location.hostname === 'localhost'
27+
? 'http://localhost:8080/#/quiz'
28+
: 'https://bb84-simulation.vercel.app/#/quiz';
29+
2530
const { data, error } = await supabase.auth.signInWithOAuth({
2631
provider: 'google',
2732
options: {
28-
redirectTo: `${window.location.origin}/#/quiz`,
33+
redirectTo: redirectUrl,
2934
},
3035
});
3136
return { data, error };

0 commit comments

Comments
 (0)