mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 21:11:22 -05:00
Fix: Resolve authentication state recognition issues
This commit is contained in:
@@ -93,6 +93,8 @@ function AuthProviderComponent({ children }: { children: React.ReactNode }) {
|
||||
const {
|
||||
data: { subscription },
|
||||
} = supabase.auth.onAuthStateChange((event, session) => {
|
||||
console.log('[Auth] State change:', event, 'User:', session?.user?.email || 'none');
|
||||
|
||||
if (!isMountedRef.current) return;
|
||||
|
||||
const currentEmail = session?.user?.email;
|
||||
@@ -100,6 +102,7 @@ function AuthProviderComponent({ children }: { children: React.ReactNode }) {
|
||||
|
||||
// Explicitly handle SIGNED_IN event for iframe compatibility
|
||||
if (event === 'SIGNED_IN' && session) {
|
||||
console.log('[Auth] SIGNED_IN detected, setting session and user');
|
||||
setSession(session);
|
||||
setUser(session.user);
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user