fix(auth): oidc-react-issue (#4410)

Co-authored-by: James Petts <jamespetts@Yunu-MacBookPro-JamesPetts.local>
This commit is contained in:
James PettsandJames Petts authored and GitHub committed 2024-10-11 09:09:26 -04:00
1 parent 0495020389
commit e849199eb0
2 files changed
+9 -4

No files matched your search

+4 -1
View File
@@ -95,7 +95,10 @@ export default function ModeRoute({
await extensionManager.registerExtension(extension);
}
}
setExtensionDependenciesLoaded(true);
if (isMounted.current) {
setExtensionDependenciesLoaded(true);
}
};
loadExtensions();
@@ -44,7 +44,7 @@ const initUserManager = (oidc, routerBasename) => {
post_logout_redirect_uri: _makeAbsoluteIfNecessary(post_logout_redirect_uri, baseUri),
});
const client = firstOpenIdClient.useAuthorizationCodeFlow ? NextClient: LegacyClient
const client = firstOpenIdClient.useAuthorizationCodeFlow ? NextClient : LegacyClient
return client(openIdConnectConfiguration);
};
@@ -110,8 +110,10 @@ function OpenIdConnectRoutes({ oidc, routerBasename, userAuthenticationService }
};
};
const handleUnauthenticated = async () => {
await userManager.signinRedirect();
const handleUnauthenticated = () => {
// Note: Don't await the redirect. If you make this component async it
// causes a react error before redirect as it returns a promise of a component rather than a component.
userManager.signinRedirect();
// return null because this is used in a react component
return null;