diff --git a/src/components/auth/google-button.tsx b/src/components/auth/google-button.tsx index d1e7282..b0cb796 100644 --- a/src/components/auth/google-button.tsx +++ b/src/components/auth/google-button.tsx @@ -32,13 +32,16 @@ export function GoogleSignInButton() { const [loading, setLoading] = useState(false) const supabase = createClient() + // Use configured APP_URL for OAuth callback + const appUrl = process.env.NEXT_PUBLIC_APP_URL || window.location.origin + async function handleGoogleSignIn() { setLoading(true) const { error } = await supabase.auth.signInWithOAuth({ provider: 'google', options: { - redirectTo: `${window.location.origin}/leopost/auth/callback/`, + redirectTo: `${appUrl}/auth/callback/`, queryParams: { access_type: 'offline', prompt: 'consent',