null check refresh promise

This commit is contained in:
Kyle Spearrin 2017-10-19 21:20:32 -04:00
parent c3653577c6
commit 805393b4db
1 changed files with 6 additions and 1 deletions

View File

@ -49,7 +49,12 @@ angular
return token;
}
refreshPromise = authService.refreshAccessToken().then(function (newToken) {
var p = authService.refreshAccessToken();
if (!p) {
return;
}
refreshPromise = p.then(function (newToken) {
refreshPromise = null;
return newToken || token;
});