mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 09:49:40 +02:00
feat(auth): add session expired banner when token refresh fails
Users now see an amber banner with a re-login button instead of a broken empty page when their session expires. Uses pub/sub events from tokenManager, integrated in todo, calendar, zitare, contacts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
02db49175a
commit
d6440664ac
9 changed files with 376 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import type {
|
|||
import { TokenState as TokenStateEnum } from '../types';
|
||||
import { isDeviceConnected, hasStableConnection } from '../adapters/network';
|
||||
import type { AuthService } from './authService';
|
||||
import { emitSessionExpired } from '../events/sessionExpired';
|
||||
|
||||
/**
|
||||
* Configuration for the token manager
|
||||
|
|
@ -110,6 +111,7 @@ export function createTokenManager(authService: AuthService, config?: TokenManag
|
|||
try {
|
||||
await authService.clearAuthStorage();
|
||||
setState(TokenStateEnum.EXPIRED);
|
||||
emitSessionExpired();
|
||||
} catch (error) {
|
||||
console.debug('Error in handleRefreshFailure:', error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue