mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 18:11:12 -05:00
Fix: Deduplicate toast and add session dismissal
This commit is contained in:
@@ -7,6 +7,7 @@ export const SessionFlags = {
|
||||
MFA_INTENDED_PATH: 'mfa_intended_path',
|
||||
MFA_CHALLENGE_ID: 'mfa_challenge_id',
|
||||
AUTH_METHOD: 'auth_method',
|
||||
ORPHANED_PASSWORD_DISMISSED: 'orphaned_password_dismissed',
|
||||
} as const;
|
||||
|
||||
export type SessionFlagKey = typeof SessionFlags[keyof typeof SessionFlags];
|
||||
@@ -73,6 +74,27 @@ export function clearAuthMethod(): void {
|
||||
sessionStorage.removeItem(SessionFlags.AUTH_METHOD);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the orphaned password dismissed flag
|
||||
*/
|
||||
export function setOrphanedPasswordDismissed(): void {
|
||||
sessionStorage.setItem(SessionFlags.ORPHANED_PASSWORD_DISMISSED, 'true');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if orphaned password warning has been dismissed this session
|
||||
*/
|
||||
export function isOrphanedPasswordDismissed(): boolean {
|
||||
return sessionStorage.getItem(SessionFlags.ORPHANED_PASSWORD_DISMISSED) === 'true';
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the orphaned password dismissed flag
|
||||
*/
|
||||
export function clearOrphanedPasswordDismissed(): void {
|
||||
sessionStorage.removeItem(SessionFlags.ORPHANED_PASSWORD_DISMISSED);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all authentication-related session flags
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user