- sendcoins
- font - catalogo
This commit is contained in:
@@ -92,7 +92,8 @@ export const Api = {
|
||||
const refrTok = localStorage.getItem(toolsext.localStorage.refreshToken);
|
||||
|
||||
if (!refrTok || refrTok === 'undefined') {
|
||||
throw new Error('Refresh token non disponibile');
|
||||
//throw new Error('Refresh token non disponibile');
|
||||
return false;
|
||||
}
|
||||
|
||||
const response = await sendRequest('/users/newtok', 'POST', { refreshToken: refrTok });
|
||||
@@ -145,14 +146,16 @@ export const Api = {
|
||||
} catch (err2) {
|
||||
console.error('Errore durante il refresh token:', err2);
|
||||
|
||||
if (err2?.code === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
let mystatus = err2?.code || err2?.status
|
||||
|
||||
if (mystatus === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN || mystatus === toolsext.ERR_RETRY_LOGIN) {
|
||||
userStore.setServerCode(toolsext.ERR_AUTHENTICATION);
|
||||
userStore.setAuth('', '');
|
||||
throw { status: err2.code };
|
||||
throw { status: toolsext.ERR_RETRY_LOGIN };
|
||||
}
|
||||
|
||||
// Gestione di altri errori critici
|
||||
throw err2;
|
||||
throw err2 || {status: serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN} ;
|
||||
}
|
||||
} else if (status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) {
|
||||
userStore.setAuth('', '');
|
||||
|
||||
Reference in New Issue
Block a user