fix(ui): logout needs access token before clearing session - #2340
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used📓 Path-based instructions (3)**/*⚙️ CodeRabbit configuration file
Files:
**/*.spec.ts⚙️ CodeRabbit configuration file
Files:
**/*.service.ts⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (5)📚 Learning: 2026-04-05T21:16:01.715ZApplied to files:
📚 Learning: 2026-04-07T09:28:09.587ZApplied to files:
📚 Learning: 2026-04-11T03:55:57.229ZApplied to files:
📚 Learning: 2026-05-18T14:54:39.422ZApplied to files:
📚 Learning: 2026-06-30T01:30:43.644ZApplied to files:
🔇 Additional comments (2)
Walkthrough
ChangesLogout session cleanup
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to This localized logout change defers session clearing until the authenticated request completes; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
alexhb1
left a comment
There was a problem hiding this comment.
Would it be worth adding a standard RXJS timeout to trigger clearSession() in the case of a hung / bad connection? Those would have no error state but could leave logout as unresponsive and unable to retry after this change.
They should be able to log out again, shouldn't they? I feel like an error shouldn't even clear the session because the logout request needs to actually happen for the frontend to know it has to do a redirect to do an IDP logout.. at least if we want to be correct. |
|
Makes sense yeah. No issues anyway, just a random thought. fine to merge :) |
Description
The logout button clears the user's session so the auth token is removed before we make the request. This causes the logout request to fail, because the
logoutrequest requires the login token.We can actually call the
logoutendpoint properly by waiting to clear the session until after the request completesLinked Issue
fixes #2339
Changes
moves
clearSessionto after logout request completesManual Testing Steps
Screenshots (Optional)
Additional Context (Optional)
It's possible the endpoint isn't working as expected but a log out request requiring a valid access token makes sense to me.
AI Disclosure
None.
Checklist
just ui checkandjust api check.Summary by CodeRabbit