Files
ctms/frontend/src/utils/auth.ts
T
Cheng Zhou 74feca4467 feat: harden auth and study workflows
- replace plaintext login and unlock requests with RSA-OAEP/AES-GCM encrypted payloads

- add login challenge replay protection, production RSA key validation, and auth tests

- wire compose to environment-driven dev/prod settings without committing local secrets

- update setup-config smoke scripts and Postman docs for encrypted login

- add visit schedule migrations/tests and update study/subject setup workflows
2026-05-08 22:16:43 +08:00

12 lines
290 B
TypeScript

const TOKEN_KEY = "ctms_token";
export const getToken = (): string | null => localStorage.getItem(TOKEN_KEY);
export const setToken = (token: string): void => {
localStorage.setItem(TOKEN_KEY, token);
};
export const clearToken = (): void => {
localStorage.removeItem(TOKEN_KEY);
};