Google OAuth login failing with "No access token in callback" error.
Supabase redirect URL not configured properly in Supabase dashboard.
Go to your Supabase Dashboard:
-
Navigate to Authentication → URL Configuration
-
Add the following URLs to Redirect URLs:
Production:
https://property-manager-ke.vercel.app/auth-callbackDevelopment (if needed):
http://localhost:5173/auth-callback -
Click Save
In Supabase Dashboard → Authentication → Providers:
-
Click on Google
-
Ensure:
- ✅ Enabled is checked
- ✅ Client ID is set (from Google Cloud Console)
- ✅ Client Secret is set (from Google Cloud Console)
- ✅ Authorized Client IDs (if using additional platforms)
-
Important: Verify the Redirect URL shown in Supabase matches what you've configured in Google Cloud Console
Go to https://console.cloud.google.com/
-
Navigate to APIs & Services → Credentials
-
Click on your OAuth 2.0 Client ID
-
Add to Authorized redirect URIs:
https://emdahodfztpfdjkrbnqz.supabase.co/auth/v1/callbackNote: Your Supabase project URL is
https://emdahodfztpfdjkrbnqz.supabase.coThe callback must be:https://YOUR_PROJECT.supabase.co/auth/v1/callback -
Click Save
- Clear browser cookies and cache
- Go to https://property-manager-ke.vercel.app
- Click "Sign in with Google"
- Complete OAuth flow
- Should redirect to
/auth-callbackthen/dashboard
If still failing, check browser console and Vercel logs for:
- Hash fragment in URL: Should see
#access_token=... - Query params: Might see
?code=...(PKCE flow - not currently supported) - Error messages in callback handler
If you prefer PKCE (more secure), update /api/login.ts:
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
redirectTo: `${origin}/auth-callback`,
queryParams: {
access_type: 'offline',
prompt: 'consent',
},
skipBrowserRedirect: false,
}
});Then implement code exchange in auth-callback.tsx (requires backend endpoint).
✅ Implicit flow (hash-based) - Preferred for your setup
❌ PKCE flow (code-based) - Not implemented yet