Refactor: Update auth callback logic

This commit is contained in:
gpt-engineer-app[bot]
2025-10-11 23:58:18 +00:00
parent d6f9f4d9a3
commit 5e0671f79e
3 changed files with 115 additions and 1 deletions

View File

@@ -225,7 +225,11 @@ export function AuthModal({ open, onOpenChange, defaultTab = 'signin' }: AuthMod
const { error } = await supabase.auth.signInWithOAuth({
provider,
options: {
redirectTo: `${window.location.origin}/`
redirectTo: `${window.location.origin}/auth/callback`,
// Request additional scopes for avatar access
scopes: provider === 'google'
? 'email profile'
: 'identify email'
}
});
if (error) throw error;

View File

@@ -1352,6 +1352,7 @@ export type Database = {
home_park_id: string | null
id: string
location_id: string | null
oauth_provider: string | null
park_count: number | null
personal_location: string | null
preferred_language: string | null
@@ -1379,6 +1380,7 @@ export type Database = {
home_park_id?: string | null
id?: string
location_id?: string | null
oauth_provider?: string | null
park_count?: number | null
personal_location?: string | null
preferred_language?: string | null
@@ -1406,6 +1408,7 @@ export type Database = {
home_park_id?: string | null
id?: string
location_id?: string | null
oauth_provider?: string | null
park_count?: number | null
personal_location?: string | null
preferred_language?: string | null