This commit is contained in:
ThePetrovich 2025-07-06 20:51:35 +08:00
parent 4bb7d214e8
commit 4360a54b58

View file

@ -11,7 +11,10 @@ export async function getCsrfToken(): Promise<string | null> {
export async function getCsrfTokenAuth(): Promise<string | null> {
try {
await fetch(CSRF_URL, {});
await fetch(CSRF_URL, {
method: 'GET',
credentials: 'include'
});
return Cookies.get('csrftoken') || null;
} catch (error) {
console.error('Failed to get CSRF token:', error);