mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 07:11:11 -05:00
Fix: Prevent logout on email change cancellation
This commit is contained in:
@@ -11,6 +11,7 @@ interface AuthContextType {
|
||||
pendingEmail: string | null;
|
||||
signOut: () => Promise<void>;
|
||||
refreshProfile: () => Promise<void>;
|
||||
clearPendingEmail: () => void;
|
||||
}
|
||||
|
||||
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
||||
@@ -152,6 +153,10 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
};
|
||||
|
||||
const clearPendingEmail = () => {
|
||||
setPendingEmail(null);
|
||||
};
|
||||
|
||||
const value = {
|
||||
user,
|
||||
session,
|
||||
@@ -160,6 +165,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
pendingEmail,
|
||||
signOut,
|
||||
refreshProfile,
|
||||
clearPendingEmail,
|
||||
};
|
||||
|
||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
||||
|
||||
Reference in New Issue
Block a user