This commit is contained in:
dcore94 2022-09-15 15:49:51 +02:00
parent 9411728b3a
commit 12d3d7eb97
1 changed files with 4 additions and 4 deletions

View File

@ -658,17 +658,17 @@
body : params,
credentials: "include"
}).then(resp=>{
if(req.status == 200){
return req.json()
if(resp.status == 200){
return resp.json()
}
if (req.status == 400) {
if (resp.status == 400) {
kc.clearToken();
}
throw "Failed to refresh token"
}).then(body=>{
logInfo('[KEYCLOAK] Token refreshed');
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);
kc.onAuthRefreshSuccess && kc.onAuthRefreshSuccess();
for (var p = refreshQueue.pop(); p != null; p = refreshQueue.pop()) {