oidc-react
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -59,3 +59,3 @@ "use strict"; | ||
return props.userManager; | ||
const { authority, clientId, clientSecret, redirectUri, responseType, scope, automaticSilentRenew, loadUserInfo, popupWindowFeatures, popupRedirectUri, popupWindowTarget } = props; | ||
const { authority, clientId, clientSecret, redirectUri, postLogoutRedirectUri, responseType, scope, automaticSilentRenew, loadUserInfo, popupWindowFeatures, popupRedirectUri, popupWindowTarget, } = props; | ||
return new oidc_client_1.UserManager({ | ||
@@ -67,3 +67,3 @@ authority, | ||
silent_redirect_uri: redirectUri, | ||
post_logout_redirect_uri: redirectUri, | ||
post_logout_redirect_uri: postLogoutRedirectUri || redirectUri, | ||
response_type: responseType || 'code', | ||
@@ -92,3 +92,9 @@ scope: scope || 'openid', | ||
}); | ||
const isMountedRef = react_1.useRef(true); | ||
react_1.useEffect(() => { | ||
return () => { | ||
isMountedRef.current = false; | ||
}; | ||
}, []); | ||
react_1.useEffect(() => { | ||
const getUser = () => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -107,3 +113,3 @@ if (exports.hasCodeInUrl(location)) { | ||
else { | ||
setUserData(user); | ||
isMountedRef.current && setUserData(user); | ||
} | ||
@@ -117,3 +123,3 @@ return; | ||
const user = yield userManager.getUser(); | ||
setUserData(user); | ||
isMountedRef.current && setUserData(user); | ||
}); | ||
@@ -120,0 +126,0 @@ userManager.events.addUserLoaded(updateUserData); |
@@ -15,2 +15,3 @@ import { UserManager, User } from 'oidc-client'; | ||
redirectUri?: string; | ||
postLogoutRedirectUri?: string; | ||
responseType?: string; | ||
@@ -17,0 +18,0 @@ scope?: string; |
@@ -6,2 +6,9 @@ # Changelog | ||
## [1.2.1](https://github.com/bjerkio/oidc-react/compare/v1.2.0...v1.2.1) (2021-03-09) | ||
### Bug Fixes | ||
* state update on an unmounted component ([#522](https://github.com/bjerkio/oidc-react/issues/522)) ([0e873f4](https://github.com/bjerkio/oidc-react/commit/0e873f4e6ac7d14cc39f4cb5196b2a79b866da93)) | ||
# [1.2.0](https://github.com/bjerkio/oidc-react/compare/v1.1.6...v1.2.0) (2021-03-08) | ||
@@ -8,0 +15,0 @@ |
{ | ||
"name": "oidc-react", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "", |
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
24411
243