fix: authorization / registration

This commit is contained in:
2026-05-10 19:39:41 +03:00
parent 7720adf616
commit 5ed79d8282
3 changed files with 8 additions and 0 deletions

View File

@@ -7,6 +7,10 @@ interface CsrfResponse {
let cachedToken: string | null = null
export function clearCsrfCache(): void {
cachedToken = null
}
export async function getCsrfToken(): Promise<string> {
if (cachedToken) return cachedToken
const res = await fetch(`${API_URL}/csrf/token`, {