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

Code Lines not triggering after signinRedirect() Function

Open TejasRGitHub opened this issue 2 years ago • 1 comments

As per my knowledge signinRedirect return a Promise. I am trying to change the states in my nested components once the login has successfully happened.

I am trying to do something like

const someFunction() = async () {
        await signinRedirect();
        console.log("Logged In!);
}

Once this is done, I am redirected to the signinpage and then once I perform the login I goto the my dashboard in the console I don't see the console.log("Logged In!); printed. I am also doing Preserve Log in the browser developer tools.

TejasRGitHub avatar Nov 10 '23 16:11 TejasRGitHub

Signin is tricky, as it involves the redirect callback mechanisms. Try to log in onSigninCallback: https://github.com/authts/react-oidc-context/blob/48708b6a45c816fec94f692d113266c957c1f792/src/AuthProvider.tsx#L45

Or add full logging like described here https://authts.github.io/oidc-client-ts/#md:logging

pamapa avatar Nov 13 '23 14:11 pamapa