fix(auth): oidc-react-issue (#4410)
Co-authored-by: James Petts <jamespetts@Yunu-MacBookPro-JamesPetts.local>
This commit is contained in:
parent
0495020389
commit
e849199eb0
@ -95,7 +95,10 @@ export default function ModeRoute({
|
|||||||
await extensionManager.registerExtension(extension);
|
await extensionManager.registerExtension(extension);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setExtensionDependenciesLoaded(true);
|
|
||||||
|
if (isMounted.current) {
|
||||||
|
setExtensionDependenciesLoaded(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
loadExtensions();
|
loadExtensions();
|
||||||
|
|||||||
@ -44,7 +44,7 @@ const initUserManager = (oidc, routerBasename) => {
|
|||||||
post_logout_redirect_uri: _makeAbsoluteIfNecessary(post_logout_redirect_uri, baseUri),
|
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);
|
return client(openIdConnectConfiguration);
|
||||||
};
|
};
|
||||||
@ -110,8 +110,10 @@ function OpenIdConnectRoutes({ oidc, routerBasename, userAuthenticationService }
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUnauthenticated = async () => {
|
const handleUnauthenticated = () => {
|
||||||
await userManager.signinRedirect();
|
// 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 because this is used in a react component
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user