- fix: refresh token, codice di errore ...
This commit is contained in:
@@ -114,9 +114,9 @@ export const Api = {
|
||||
} catch (error) {
|
||||
console.error('Errore durante il refresh token:', error);
|
||||
// Logout dell'utente in caso di errore critico
|
||||
userStore.setAuth('', '');
|
||||
localStorage.removeItem(toolsext.localStorage.token);
|
||||
localStorage.removeItem(toolsext.localStorage.refreshToken);
|
||||
// userStore.setAuth('', '');
|
||||
// localStorage.removeItem(toolsext.localStorage.token);
|
||||
// localStorage.removeItem(toolsext.localStorage.refreshToken);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
@@ -147,15 +147,15 @@ export const Api = {
|
||||
|
||||
if (err2?.code === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
userStore.setServerCode(toolsext.ERR_AUTHENTICATION);
|
||||
// userStore.setAuth('', '');
|
||||
throw { status: toolsext.ERR_RETRY_LOGIN };
|
||||
userStore.setAuth('', '');
|
||||
throw { status: err2.code };
|
||||
}
|
||||
|
||||
// Gestione di altri errori critici
|
||||
throw err2;
|
||||
}
|
||||
} else if (status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
// userStore.setAuth('', '');
|
||||
userStore.setAuth('', '');
|
||||
const $router = useRouter()
|
||||
throw { status: toolsext.ERR_RETRY_LOGIN };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user