-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
I'm trying to use oidc-react with an application that can work offline. But I have redirect even if offline. Is there a way to disable oidc when offline ? This is what I tried but it still try to redirect when offline. Did I miss something ?
export function OidcProvider({ children }: PropsWithChildren) {
const isOnline = useOnline();
if (!isOnline) {
return (
<AuthProvider
userManager={undefined}
authority={import.meta.env.VITE_AUTHORITY}
clientId={import.meta.env.VITE_CLIENT_ID}
redirectUri={import.meta.env.VITE_REDIRECT_URI}
automaticSilentRenew={false}
autoSignIn={false}
autoSignOut={false}
>
{children}
</AuthProvider>
);
}
return (
<AuthProvider
userManager={isSSO ? userManager : undefined}
onSignIn={onSignIn}
authority={import.meta.env.VITE_AUTHORITY}
clientId={import.meta.env.VITE_CLIENT_ID}
redirectUri={import.meta.env.VITE_REDIRECT_URI}
automaticSilentRenew={true}
>
{children}
</AuthProvider>
);
}Metadata
Metadata
Assignees
Labels
No labels