Files
aplp.frontend.web/src/api/tokenStorage.ts
T
2026-08-11 21:09:32 +07:00

19 lines
493 B
TypeScript

/**
* In-memory token storage.
*
* Access token is kept in memory only (never persisted to localStorage /
* sessionStorage) to reduce XSS exposure. The refresh token is handled by the
* backend (HttpOnly cookie), so the client never touches it directly.
*/
let accessToken: string | null = null;
export const tokenStorage = {
get: (): string | null => accessToken,
set: (token: string): void => {
accessToken = token;
},
clear: (): void => {
accessToken = null;
},
};