fix: authorization / registration
This commit is contained in:
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user