diff --git a/resources/js/api/index.ts b/resources/js/api/index.ts index e2a27fe..642bc2e 100644 --- a/resources/js/api/index.ts +++ b/resources/js/api/index.ts @@ -38,7 +38,6 @@ export class ApiService { }): Promise { let body: string | null = null; const fullUrl = url; - const csrf = document.head.querySelector('meta[name="csrf-token"]')?.getAttribute('content'); if (Object.keys(data).length > 0) { body = JSON.stringify(data); @@ -46,8 +45,6 @@ export class ApiService { if (!useAppStore().isMultiTenant) { headers.Authorization = useAppStore().config.authorization_token; - } else { - headers['X-CSRF-TOKEN'] = csrf; } const resp = await fetch(fullUrl, { @@ -63,9 +60,7 @@ export class ApiService { }); if (resp.status === 419 && nest && useAppStore().isMultiTenant) { - if (await this.reloadCsrf()) { - return this.request({ url, method, data, headers }); - } + return this.request({ url, method, data, headers }); } if (resp.status === 204) { diff --git a/resources/js/components/pages/Settings.vue b/resources/js/components/pages/Settings.vue index 66b9367..3181793 100644 --- a/resources/js/components/pages/Settings.vue +++ b/resources/js/components/pages/Settings.vue @@ -137,7 +137,6 @@ const formatName = (name: string) => { const deleteAccount = async (password) => { await AuthApi.deleteAccount(password); appStore.clearLogin(); - await ApiService.reloadCsrf(); }; watch( diff --git a/resources/js/store/index.ts b/resources/js/store/index.ts index e9965cb..767f1f3 100644 --- a/resources/js/store/index.ts +++ b/resources/js/store/index.ts @@ -216,7 +216,6 @@ export const useAppStore = defineStore('app', { throw [{ field: 'Login error', message: 'Invalid credentials' }]; } - await ApiService.reloadCsrf(); if (this.config.tenant) { await this.getUser(); if (!this.user.isVerified) { @@ -233,7 +232,6 @@ export const useAppStore = defineStore('app', { this.loggedIn = false; await AuthApi.logout(); this.clearLogin(); - await ApiService.reloadCsrf(); }, clearLogin() { this.user = null; diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index ac3db3c..97cae7a 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -3,8 +3,7 @@ - - Enjin Platform + Enjin Platform @vite('resources/css/app.css', 'vendor/platform-ui/build')