Skip to content

Commit

Permalink
change from "GET" to "POST" request for logout user or customer
Browse files Browse the repository at this point in the history
  • Loading branch information
Asif798 committed Feb 8, 2022
1 parent 9709489 commit e1e1157
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions resources/scripts/admin/stores/auth.js
Expand Up @@ -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({
Expand All @@ -55,7 +55,7 @@ export const useAuthStore = (useWindow = false) => {
})

window.router.push('/login')
// resetStore.clearPinia()
// resetStore.clearPinia()
resolve(response)
})
.catch((err) => {
Expand All @@ -67,4 +67,4 @@ export const useAuthStore = (useWindow = false) => {
},
},
})()
}
}
8 changes: 4 additions & 4 deletions resources/scripts/customer/stores/auth.js
Expand Up @@ -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',
Expand Down Expand Up @@ -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({
Expand All @@ -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({
Expand All @@ -120,4 +120,4 @@ export const useAuthStore = defineStore({
})
},
},
})
})

0 comments on commit e1e1157

Please sign in to comment.