react-oauth2-code-pkce
Advanced tools
Comparing version 1.13.0 to 1.13.1
@@ -96,9 +96,14 @@ "use strict"; | ||
try { | ||
if (response.id_token) | ||
setIdTokenData((0, decodeJWT_1.decodeJWT)(response.id_token)); | ||
} | ||
catch (e) { | ||
console.warn(`Failed to decode idToken: ${e.message}`); | ||
} | ||
try { | ||
if (config.decodeToken) | ||
setTokenData((0, decodeJWT_1.decodeJWT)(response.access_token)); | ||
if (config.decodeToken && response.id_token) | ||
setIdTokenData((0, decodeJWT_1.decodeJWT)(response.id_token)); | ||
} | ||
catch (e) { | ||
setError(e.message); | ||
console.warn(`Failed to decode access token: ${e.message}`); | ||
} | ||
@@ -162,3 +167,3 @@ } | ||
return () => clearInterval(interval); | ||
}, [token]); // This token dependency removes the old, and registers a new Interval when a new token is fetched. | ||
}, [token, refreshToken, refreshTokenExpire, tokenExpire]); // Replace the interval with a new when values used inside refreshAccessToken changes | ||
// This ref is used to make sure the 'fetchTokens' call is only made once. | ||
@@ -165,0 +170,0 @@ // Multiple calls with the same code will, and should, return an error from the API |
{ | ||
"name": "react-oauth2-code-pkce", | ||
"version": "1.13.0", | ||
"version": "1.13.1", | ||
"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
44014
725