mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 22:51:12 -05:00
Fix: Implement iframe-compatible authentication
This commit is contained in:
@@ -98,8 +98,15 @@ function AuthProviderComponent({ children }: { children: React.ReactNode }) {
|
||||
const currentEmail = session?.user?.email;
|
||||
const newEmailPending = session?.user?.new_email;
|
||||
|
||||
setSession(session);
|
||||
setUser(session?.user ?? null);
|
||||
// Explicitly handle SIGNED_IN event for iframe compatibility
|
||||
if (event === 'SIGNED_IN' && session) {
|
||||
setSession(session);
|
||||
setUser(session.user);
|
||||
setLoading(false);
|
||||
} else {
|
||||
setSession(session);
|
||||
setUser(session?.user ?? null);
|
||||
}
|
||||
|
||||
// Track pending email changes
|
||||
setPendingEmail(newEmailPending ?? null);
|
||||
|
||||
Reference in New Issue
Block a user