Closed francoguilherme closed 4 years ago
Did you end up finding a fix for this?
okay you simply need to have a conditional to check if the server has already responded and run signinRedirectCallback
or signinRedirect
depending on the state
export const Callback = () => (
<AuthConsumer>
{({ signinRedirect, signinRedirectCallback }) => {
if (Boolean(window.location.hash)) { // depends on IDENTITY_CONFIG.response_type
signinRedirectCallback();
} else {
signinRedirect();
}
}}
</AuthConsumer>
);
Hi, I implemented your code in my app but I'm having some problems.
When I try to login, in the path "/signin-oidc" I get:
*Info* "UserManager._loadUser: no user storageString"
*Info* "UserManager.getUser: user not found in storage"
*Error* "OidcClient.processSigninResponse: No state in response".
When I change the function in callback.js from signinRedirectCallback to signinRedirect, the app successfully redirects me to the Signin page, but after signing in the tokens are not set in the local storage, so when the PrivateRoute runs isAuthenticated() it's always false and falls in an infinite loop of signinRedirect().
Can you help me figure out what I'm doing wrong? I suppose i can't change the function callback.js, but I couldn't fix the "No state in response error".