Fix: Clear auth state when switching from multiuser to single-user mode#86
Merged
lstein merged 1 commit intofeature/multiuserfrom Feb 23, 2026
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix login persistence when switching to singleuser mode
Fix: Clear auth state when switching from multiuser to single-user mode
Feb 23, 2026
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
8fd6147 to
78b5783
Compare
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
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
When switching InvokeAI from multiuser → single-user mode, a JWT token persisted in
localStoragekept the Redux auth state as "authenticated", causing the user icon to remain visible without requiring a manual logout.Changes in
ProtectedRoute.tsx:multiuser_enabledisfalsebutisAuthenticatedistrue, dispatchlogout()to clear both thelocalStoragetoken and Redux auth state — the user icon disappears automatically on page load in single-user mode.multiuserEnabledguard toshouldFetchUserto prevent a race whereuseGetCurrentUserQuerycould populate user state before the logout effect ran.Related Issues / Discussions
QA Instructions
multiuser: trueininvokeai.yaml), navigate to the app, and log in.multiuser: false, restart.Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.