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:
Till JS 2026-03-24 21:24:28 +01:00
parent 02db49175a
commit d6440664ac
9 changed files with 376 additions and 0 deletions

View file

@ -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);
}