@stemy/ngx-utils 13.2.2 → 13.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2411,15 +2411,16 @@ class BaseHttpService {
|
|
|
2411
2411
|
}
|
|
2412
2412
|
const headers = options.headers;
|
|
2413
2413
|
const authKey = "Authorization";
|
|
2414
|
-
// If an authorization header exists and we still have an Unauthorized response prompt the user to log in again
|
|
2414
|
+
// If an authorization header exists, and we still have an Unauthorized response prompt the user to log in again
|
|
2415
2415
|
if (headers.has(authKey) && response.status == 401) {
|
|
2416
2416
|
const pushed = this.pushFailedRequest(url, options, () => {
|
|
2417
2417
|
options.headers = this.makeHeaders(options.originalHeaders);
|
|
2418
2418
|
this.toPromise(url, options, listener).then(resolve, reject);
|
|
2419
2419
|
});
|
|
2420
|
-
if (pushed)
|
|
2420
|
+
if (pushed) {
|
|
2421
2421
|
this.handleUnauthorizedError(absoluteUrl, options, () => reject(response));
|
|
2422
|
-
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2423
2424
|
}
|
|
2424
2425
|
reject(response);
|
|
2425
2426
|
});
|
|
@@ -2427,7 +2428,7 @@ class BaseHttpService {
|
|
|
2427
2428
|
});
|
|
2428
2429
|
}
|
|
2429
2430
|
pushFailedRequest(url, options, req) {
|
|
2430
|
-
if (url.indexOf("
|
|
2431
|
+
if (url.indexOf("token") >= 0 || url === "user")
|
|
2431
2432
|
return false;
|
|
2432
2433
|
BaseHttpService.failedRequests.push(req);
|
|
2433
2434
|
return true;
|