first commit

This commit is contained in:
2026-05-09 00:38:56 +03:00
commit 51a44ef13d
156 changed files with 9832 additions and 0 deletions

16
src/shared/api/csrf.ts Normal file
View File

@@ -0,0 +1,16 @@
import { API_URL } from '@shared/config/env'
interface CsrfResponse {
header_name: string
token: string
}
let cachedToken: string | null = null
export async function getCsrfToken(): Promise<string> {
if (cachedToken) return cachedToken
const res = await fetch(`${API_URL}/csrf/token`)
const data: CsrfResponse = await res.json()
cachedToken = data.token
return cachedToken
}