Fix Keycloak auth: optional chaining for useAuth hook
This commit is contained in:
@@ -24,11 +24,19 @@ function AppContent() {
|
||||
);
|
||||
}
|
||||
|
||||
const onSigninCallback = () => {
|
||||
// Remove OIDC params from URL after signin
|
||||
window.history.replaceState({}, document.title, window.location.pathname);
|
||||
};
|
||||
|
||||
function App() {
|
||||
// Only wrap with AuthProvider if Keycloak is enabled
|
||||
if (isKeycloakEnabled()) {
|
||||
return (
|
||||
<AuthProvider {...keycloakConfig}>
|
||||
<AuthProvider
|
||||
{...keycloakConfig}
|
||||
onSigninCallback={onSigninCallback}
|
||||
>
|
||||
<AppContent />
|
||||
</AuthProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user