iqa-keycloak-oauth2
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -74,5 +74,8 @@ "use strict"; | ||
} | ||
function forceRefreshToken(initial = false) { | ||
function forceRefreshToken(configParams) { | ||
if (refreshToken) { | ||
setRefreshInProgress(true); | ||
let refreshConfig = config; | ||
refreshConfig.extraTokenParameters = configParams; | ||
refreshConfig.extraAuthParameters = configParams; | ||
(0, authentication_1.fetchWithRefreshToken)({ config, refreshToken }) | ||
@@ -84,10 +87,15 @@ .then((result) => handleTokenResponse(result)) | ||
if (error.status === 400) { | ||
return handleExpiredRefreshToken(initial); | ||
return handleExpiredRefreshToken(false); | ||
} | ||
// Unknown error. Set error, and login if first page load | ||
else { | ||
console.error(error); | ||
setError(error.message); | ||
if (initial) | ||
login(); | ||
if (error.status === 403) { | ||
setError('access denied'); | ||
} | ||
else { | ||
console.error(error); | ||
setError(error.message); | ||
if (false) | ||
login(); | ||
} | ||
} | ||
@@ -99,3 +107,3 @@ } | ||
setError(error.message); | ||
if (initial) | ||
if (false) | ||
login(); | ||
@@ -102,0 +110,0 @@ } |
{ | ||
"name": "iqa-keycloak-oauth2", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Provider agnostic react package for OAuth2 Authorization Code flow with PKCE", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38747
799