Files
gold_land_user/src/api/token.ts
T
safavimohadeseh78andCursor e3f0457dc9
Frontend CI / unit (test, type-check, build) (push) Successful in 1m11s
Frontend CI / browser E2E (frontend + pinned backend) (push) Failing after 2m48s
feat: complete server-backed six-lesson app and trial tooling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 14:40:37 +03:30

23 lines
458 B
TypeScript

const TOKEN_KEY = 'gold-land-auth-token'
let authToken: string | null = null
export function getAuthToken(): string | null {
if (authToken) return authToken
try {
return localStorage.getItem(TOKEN_KEY)
} catch {
return null
}
}
export function setAuthToken(token: string | null) {
authToken = token
try {
if (token) localStorage.setItem(TOKEN_KEY, token)
else localStorage.removeItem(TOKEN_KEY)
} catch {
// ignore
}
}