This commit is contained in:
2026-08-11 21:09:32 +07:00
parent e63c8f61aa
commit 94c0c47fd0
44 changed files with 5215 additions and 71 deletions
+18
View File
@@ -0,0 +1,18 @@
/**
* 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;
},
};