react-oidc-context icon indicating copy to clipboard operation
react-oidc-context copied to clipboard

Typo in README

Open fatihcatalkaya opened this issue 2 years ago • 1 comments

Hey,

today I was implementing OIDC using your library. In this process, I think I came across a typo in one of the examples. In the "automatic sign-in" section it says

React.useEffect(() => {
        if (!hasAuthParams() &&
            !auth.isAuthenticated && !auth.activeNavigator && !auth.isLoading &&
            !hasTriedSignin
        ) {
            auth.signinRedirect();
            setHasTriedSignin(true);
        }
    }, [auth, hasTriedSignin]);

I got the snipped to work, by checking for hasAuthParams() instead of !hasAuthParams(). Is this a real typo, or am I making something wrong? By removing the exclamation mark, I got it to work.

fatihcatalkaya avatar Oct 29 '23 17:10 fatihcatalkaya

i guess the readme is correct, in case of hasAuthParams() the context is a callback and the library itself handles that callback...

pamapa avatar Oct 30 '23 09:10 pamapa