-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React SPA - Unable to logout user #1214
Comments
|
Hi, @pamapa Thank you for responding. Could you please provide me with any references for the implementation you have suggested? It would be quite beneficial to me. Also, if I use this method:
I'm receiving the following error:
|
Your current code results in race between You could try running the 2nd call only on the success of the first call. auth
.removeUser()
.then(() => {
void auth.signoutRedirect();
})
.catch((error) => {
// Unable to remove user...
}); |
Hi, @tejasmudholkar I'm experiencing the same issue. Did you manage to solve this issue? |
Hi @dszy579 I did something similar, and it solved my problem.
|
I have a react application where I have integrated OIDC connect through react-oidc-context referring to installation instructions with some additions. I can Sign the user in the application. Doing so redirects me to the OIDC Sign-In screen, I fill in credentials, and then I am redirected back to my React SPA and my access token is available. All good so far. However, clicking Sign Out I am redirected to OP /logout. If I then navigate back in the browser I again get logged in without asking for credentials but if I refresh the screen then I get logged out.
Can you please help me with this?
My OIDC configuration
Here is my Login file
Logout method to logout user
I tried adding
revokeTokenTypes: ["access_token", "refresh_token"], revokeTokensOnSignout: true
properties in the oidc config file, but it didn't work. I expect the user to be logged out after logging out, and if he clicks the browser back button, he should not be led back to the application, but rather remain on the login screen.The text was updated successfully, but these errors were encountered: