Hitting Log Out with no usable session was sending users to Keycloak /logout without a valid id_token_hint, which showed the “Do you want to log out?” page. Logout now goes to Keycloak only when a session, id_token, and successful refresh exist; otherwise it goes to /login, which already calls signIn('keycloak').So it was suggested don't show logout page instead redirect to login
Issue : This logout page does not make sense as we are not giving any option other than logging out
On Logout:
Still logged in: tell Keycloak to log out in the background, then go to login. Do not show the logout page.
Already expired: skip Keycloak. Go straight to login.
Users should never see the Keycloak logout page.
2.After RefreshAccessTokenError, NextAuth still kept session.user, so the homepage avatar sometimes looked logged in. SessionGuard now signOuts to clear that dead session. Dashboard still redirects to Keycloak login, same as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue : This logout page does not make sense as we are not giving any option other than logging out
On Logout:
Still logged in: tell Keycloak to log out in the background, then go to login. Do not show the logout page.
Already expired: skip Keycloak. Go straight to login.
Users should never see the Keycloak logout page.
2.After RefreshAccessTokenError, NextAuth still kept session.user, so the homepage avatar sometimes looked logged in. SessionGuard now signOuts to clear that dead session. Dashboard still redirects to Keycloak login, same as before.