fixed
This commit is contained in:
parent
9411728b3a
commit
12d3d7eb97
|
@ -658,17 +658,17 @@
|
||||||
body : params,
|
body : params,
|
||||||
credentials: "include"
|
credentials: "include"
|
||||||
}).then(resp=>{
|
}).then(resp=>{
|
||||||
if(req.status == 200){
|
if(resp.status == 200){
|
||||||
return req.json()
|
return resp.json()
|
||||||
}
|
}
|
||||||
if (req.status == 400) {
|
if (resp.status == 400) {
|
||||||
kc.clearToken();
|
kc.clearToken();
|
||||||
}
|
}
|
||||||
throw "Failed to refresh token"
|
throw "Failed to refresh token"
|
||||||
}).then(body=>{
|
}).then(body=>{
|
||||||
logInfo('[KEYCLOAK] Token refreshed');
|
logInfo('[KEYCLOAK] Token refreshed');
|
||||||
timeLocal = (timeLocal + new Date().getTime()) / 2;
|
timeLocal = (timeLocal + new Date().getTime()) / 2;
|
||||||
var tokenResponse = JSON.parse(req.responseText);
|
var tokenResponse = body
|
||||||
setToken(tokenResponse['access_token'], tokenResponse['refresh_token'], tokenResponse['id_token'], timeLocal);
|
setToken(tokenResponse['access_token'], tokenResponse['refresh_token'], tokenResponse['id_token'], timeLocal);
|
||||||
kc.onAuthRefreshSuccess && kc.onAuthRefreshSuccess();
|
kc.onAuthRefreshSuccess && kc.onAuthRefreshSuccess();
|
||||||
for (var p = refreshQueue.pop(); p != null; p = refreshQueue.pop()) {
|
for (var p = refreshQueue.pop(); p != null; p = refreshQueue.pop()) {
|
||||||
|
|
Loading…
Reference in New Issue