From e1e1157f2d45ed82fd868dc2454b3b2b99ce4b9b Mon Sep 17 00:00:00 2001 From: asift798 Date: Tue, 8 Feb 2022 12:38:52 +0530 Subject: [PATCH 1/3] change from "GET" to "POST" request for logout user or customer --- resources/scripts/admin/stores/auth.js | 6 +++--- resources/scripts/customer/stores/auth.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/scripts/admin/stores/auth.js b/resources/scripts/admin/stores/auth.js index 220c3c17..363bd735 100644 --- a/resources/scripts/admin/stores/auth.js +++ b/resources/scripts/admin/stores/auth.js @@ -46,7 +46,7 @@ export const useAuthStore = (useWindow = false) => { logout() { return new Promise((resolve, reject) => { axios - .get('/auth/logout') + .post('/auth/logout') .then((response) => { const notificationStore = useNotificationStore() notificationStore.showNotification({ @@ -55,7 +55,7 @@ export const useAuthStore = (useWindow = false) => { }) window.router.push('/login') - // resetStore.clearPinia() + // resetStore.clearPinia() resolve(response) }) .catch((err) => { @@ -67,4 +67,4 @@ export const useAuthStore = (useWindow = false) => { }, }, })() -} +} \ No newline at end of file diff --git a/resources/scripts/customer/stores/auth.js b/resources/scripts/customer/stores/auth.js index 2087596f..19e3d44e 100644 --- a/resources/scripts/customer/stores/auth.js +++ b/resources/scripts/customer/stores/auth.js @@ -50,7 +50,7 @@ export const useAuthStore = defineStore({ axios .post(`/api/v1/${data.company}/customer/auth/password/email`, data) - .then((response) => { + .then((response) => { if (response.data) { notificationStore.showNotification({ type: 'success', @@ -78,7 +78,7 @@ export const useAuthStore = defineStore({ axios .post(`/api/v1/${company}/customer/auth/reset/password`, data) - .then((response) => { + .then((response) => { if (response.data) { const notificationStore = useNotificationStore(true) notificationStore.showNotification({ @@ -103,7 +103,7 @@ export const useAuthStore = defineStore({ logout(data) { return new Promise((resolve, reject) => { axios - .get(`${data}/customer/logout`) + .post(`${data}/customer/logout`) .then((response) => { const notificationStore = useNotificationStore() notificationStore.showNotification({ @@ -120,4 +120,4 @@ export const useAuthStore = defineStore({ }) }, }, -}) +}) \ No newline at end of file From 2b7028b7c83fd6e8897f244a2e6723baa20479e5 Mon Sep 17 00:00:00 2001 From: harshjagad20 Date: Fri, 11 Feb 2022 09:39:11 +0530 Subject: [PATCH 2/3] changed route method --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 0e254368..7cb68846 100644 --- a/routes/web.php +++ b/routes/web.php @@ -42,7 +42,7 @@ Route::get('/modules/scripts/{script}', ScriptController::class); Route::post('login', [LoginController::class, 'login']); -Route::get('auth/logout', function () { +Route::post('auth/logout', function () { Auth::guard('web')->logout(); }); From e8a88dbad34a8f293cf75237bcc9e7b8e7e07a2a Mon Sep 17 00:00:00 2001 From: harshjagad20 Date: Fri, 11 Feb 2022 09:51:41 +0530 Subject: [PATCH 3/3] change customer logout route method --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 7cb68846..ac694513 100644 --- a/routes/web.php +++ b/routes/web.php @@ -52,7 +52,7 @@ Route::post('auth/logout', function () { Route::post('/{company:slug}/customer/login', CustomerLoginController::class); -Route::get('/{company:slug}/customer/logout', function () { +Route::post('/{company:slug}/customer/logout', function () { Auth::guard('customer')->logout(); });