Skip to content

feat(auth): add /logout command#67

Open
bleubleub wants to merge 1 commit intomindspore-lab:mainfrom
bleubleub:feat/logout-command
Open

feat(auth): add /logout command#67
bleubleub wants to merge 1 commit intomindspore-lab:mainfrom
bleubleub:feat/logout-command

Conversation

@bleubleub
Copy link
Copy Markdown
Collaborator

@bleubleub bleubleub commented Apr 15, 2026

Summary

  • Add /logout command clearing issue server credentials and in-session state
  • For mscli-provided mode: also clears config.json and resets Config.Model (ModelToken is the same server token)
  • Handles both mid-session preset switches and startup-restored preset path
  • Emits ModelUpdate with empty model name so UI top bar refreshes on logout
  • Register /logout in slash command autocomplete
  • Update /login and /logout descriptions to 'issue server'

Test plan

  • go test ./internal/app/... -run TestCmdLogout -v — 4 tests pass
  • Login via model setup, then /logout — UI clears username and model bar
  • Verify ~/.mscli/credentials.json and ~/.mscli/config.json cleared
  • Re-login in same session works after logout

🤖 Generated with Claude Code

Clear credentials.json, in-session issue service state, and mscli-provided
model preset state on logout. For mscli-provided mode, also clear config.json
(ModelToken is the same server token) and reset Config.Model so the session
reflects no configured model after logout.

Handles both mid-session preset switches (modelBeforePreset != nil) and the
startup-restored preset path (modelBeforePreset == nil) correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bleubleub bleubleub requested a review from vigo999 April 15, 2026 06:20
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.

1 participant