Skip to content

Fix stale user identity after logout - #1102

Open
rootverdict wants to merge 1 commit into
dfir-iris:masterfrom
rootverdict:agent/fix-1093-clear-user-session
Open

Fix stale user identity after logout#1102
rootverdict wants to merge 1 commit into
dfir-iris:masterfrom
rootverdict:agent/fix-1093-clear-user-session

Conversation

@rootverdict

@rootverdict rootverdict commented Jul 25, 2026

Copy link
Copy Markdown

Background

Issue #1093 reports that after a user logs out and another user logs in from the same browser tab, the Alerts "Assign to me" action can still use the previous user's cached userWhoami value from sessionStorage.

Changes

  • Clear sessionStorage.userWhoami when the sidebar logout link is clicked.
  • Extend the existing dashboard logout e2e test to seed userWhoami before logout and assert it is removed afterward.

Impact

This prevents stale browser-side identity data from carrying across logout/re-login flows and assigning alerts to the wrong analyst.

Validation

  • git diff --check
  • node --check e2e/tests/administrator/dashboard.spec.js using the bundled Node runtime

Full Playwright e2e was not run locally because the Docker-backed IRIS test app and e2e dependencies were not bootstrapped in this workspace.

Closes #1093.

Summary by CodeRabbit

  • Bug Fixes
    • Improved logout behavior by clearing stored session identity information.
    • Confirmed that logging out returns users to the sign-in screen and removes stale session data.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0bff1815-ff92-4e65-b1ad-f6e6797a408b

📥 Commits

Reviewing files that changed from the base of the PR and between a4bfeda and d56970a.

📒 Files selected for processing (2)
  • e2e/tests/administrator/dashboard.spec.js
  • source/app/templates/includes/sidenav.html

Walkthrough

The logout link now clears the cached userWhoami session entry before navigation. The administrator end-to-end test seeds this entry, performs logout, verifies the “Sign In” button, and confirms the entry is removed.

Changes

Logout session cleanup

Layer / File(s) Summary
Logout link and validation
source/app/templates/includes/sidenav.html, e2e/tests/administrator/dashboard.spec.js
The logout link uses a quoted href and removes sessionStorage.userWhoami; the end-to-end test verifies logout navigation, login-page visibility, and session cleanup.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A bunny hops past logout’s door,
Clearing stale tracks from the floor.
“Sign In!” shines bright,
The session feels light,
Fresh paws may enter once more.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: clearing stale user identity data on logout.
Linked Issues check ✅ Passed The logout handler clears sessionStorage.userWhoami and the test verifies it, matching issue #1093's fix for stale identity after re-login.
Out of Scope Changes check ✅ Passed The changes stay focused on logout cleanup and the related e2e test, with no unrelated functionality introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rootverdict
rootverdict marked this pull request as ready for review July 25, 2026 12:03
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.

[BUG] "Assign to me" assigns alert to wrong user after re-login (userWhoami cached in sessionStorage)

1 participant