FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix Keycloak logout confirmation and stale logged-in avatar after token refresh fails by UdayRajSahai2 · Pull Request #436 · CivicDataLab/DataSpaceFrontend · GitHub

Fix Keycloak logout confirmation and stale logged-in avatar after token refresh fails - #436

Merged
saqibmanan merged 1 commit into
devfrom
fix-login-issues
Aug 21, 2026
Merged

Fix Keycloak logout confirmation and stale logged-in avatar after token refresh fails#436
saqibmanan merged 1 commit into
devfrom
fix-login-issues

Conversation

Copy link
Copy Markdown
Collaborator

Summary

  1. 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.

UdayRajSahai2 self-assigned this Aug 18, 2026
saqibmanan merged commit 14f0271 into dev Aug 21, 2026
1 check passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL