Gestione Refresh Token Completata !

This commit is contained in:
Surya Paolo
2024-04-11 11:43:38 +02:00
parent 62c0f497e5
commit bff31b5fd4
93 changed files with 3592683 additions and 214 deletions

View File

@@ -63,14 +63,14 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
headers: {
'Content-Type': 'application/json',
'x-auth': userStore.x_auth_token,
'x-refrTok': userStore.refreshToken,
'x-refrtok': userStore.refreshToken,
},
})
ricevuto = true
// console.log('Request Response: ', response)
// console.log(new Types.AxiosSuccess(response.data, response.status))
const setAuthToken = (path === '/updatepwd')
const setAuthToken = (path === '/updatepwd') || (path === '/users/login')
// console.log('--------- 0 ')
@@ -80,7 +80,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
try {
if (setAuthToken || (path === '/users/login')) {
x_auth_token = String(response.headers['x-auth'])
refreshToken = String(response.headers['x-refrTok'])
refreshToken = String(response.headers['x-refrtok'])
if (x_auth_token === '') {
userStore.setServerCode(toolsext.ERR_AUTHENTICATION)
@@ -117,7 +117,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
headers: {
'Content-Type': 'application/json',
'x-auth': userStore.x_auth_token,
'x-refrTok': userStore.refreshToken,
'x-refrtok': userStore.refreshToken,
},
})
ricevuto = true
@@ -128,7 +128,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
headers: {
'Content-Type': 'multipart/form-data',
'x-auth': userStore.x_auth_token,
'x-refrTok': userStore.refreshToken,
'x-refrtok': userStore.refreshToken,
},
})
ricevuto = true