mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 22:31:05 +03:30
Edit number 2
This commit is contained in:
+2
-2
@@ -62,14 +62,14 @@ const ApiService = {
|
||||
},
|
||||
async (error) => {
|
||||
if (error.request.status == 401) {
|
||||
if (error.config.url.includes('auth/login')) {
|
||||
if (error.config.url.includes('login')) {
|
||||
// Refresh token has failed. Logout the user
|
||||
store.dispatch('auth/logout');
|
||||
throw error;
|
||||
} else {
|
||||
// Refresh the access token
|
||||
try{
|
||||
await store.dispatch('auth/refreshToken')
|
||||
await store.dispatch('refreshToken')
|
||||
// Retry the original request
|
||||
return this.customRequest({
|
||||
method: error.config.method,
|
||||
|
||||
Reference in New Issue
Block a user