mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 07:11:11 -05:00
Reverted to commit 96a961d95c
This commit is contained in:
@@ -93,24 +93,13 @@ 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;
|
||||
const newEmailPending = session?.user?.new_email;
|
||||
|
||||
// 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);
|
||||
} else {
|
||||
setSession(session);
|
||||
setUser(session?.user ?? null);
|
||||
setLoading(false);
|
||||
}
|
||||
setSession(session);
|
||||
setUser(session?.user ?? null);
|
||||
|
||||
// Track pending email changes
|
||||
setPendingEmail(newEmailPending ?? null);
|
||||
|
||||
Reference in New Issue
Block a user