mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
change from "GET" to "POST" request for logout user or customer
This commit is contained in:
@ -46,7 +46,7 @@ export const useAuthStore = (useWindow = false) => {
|
|||||||
logout() {
|
logout() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios
|
axios
|
||||||
.get('/auth/logout')
|
.post('/auth/logout')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const notificationStore = useNotificationStore()
|
const notificationStore = useNotificationStore()
|
||||||
notificationStore.showNotification({
|
notificationStore.showNotification({
|
||||||
@ -55,7 +55,7 @@ export const useAuthStore = (useWindow = false) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
window.router.push('/login')
|
window.router.push('/login')
|
||||||
// resetStore.clearPinia()
|
// resetStore.clearPinia()
|
||||||
resolve(response)
|
resolve(response)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -67,4 +67,4 @@ export const useAuthStore = (useWindow = false) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ export const useAuthStore = defineStore({
|
|||||||
axios
|
axios
|
||||||
.post(`/api/v1/${data.company}/customer/auth/password/email`, data)
|
.post(`/api/v1/${data.company}/customer/auth/password/email`, data)
|
||||||
|
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
notificationStore.showNotification({
|
notificationStore.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@ -78,7 +78,7 @@ export const useAuthStore = defineStore({
|
|||||||
axios
|
axios
|
||||||
.post(`/api/v1/${company}/customer/auth/reset/password`, data)
|
.post(`/api/v1/${company}/customer/auth/reset/password`, data)
|
||||||
|
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const notificationStore = useNotificationStore(true)
|
const notificationStore = useNotificationStore(true)
|
||||||
notificationStore.showNotification({
|
notificationStore.showNotification({
|
||||||
@ -103,7 +103,7 @@ export const useAuthStore = defineStore({
|
|||||||
logout(data) {
|
logout(data) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios
|
axios
|
||||||
.get(`${data}/customer/logout`)
|
.post(`${data}/customer/logout`)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
const notificationStore = useNotificationStore()
|
const notificationStore = useNotificationStore()
|
||||||
notificationStore.showNotification({
|
notificationStore.showNotification({
|
||||||
@ -120,4 +120,4 @@ export const useAuthStore = defineStore({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user