Gestione Refresh Token Completata !
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user