Skip to content

fix(auth): persist auth token across editor process restarts (#166) - #173

Merged
Daliys merged 2 commits into
developmentfrom
daliys/issue-166-auth-token-persistence
Jul 28, 2026
Merged

fix(auth): persist auth token across editor process restarts (#166)#173
Daliys merged 2 commits into
developmentfrom
daliys/issue-166-auth-token-persistence

Conversation

@Daliys

@Daliys Daliys commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #166.

Persist authentication tokens across Unity Editor process restarts in Library/NexusUnityAuthToken.txt and EditorPrefs, preventing persistent HTTP 401 Unauthorized errors for external MCP CLI integrations (Codex, Claude Code, Gemini) after restarting Unity.

Proposed Changes

  • MCPServer.Identity.cs: Update EnsureAuthToken() to check ReadTokenFile() and project-scoped EditorPrefs when SessionState is empty. Added RotateAuthToken() helper.
  • ServerPortTests.cs: Added AuthToken_PersistsAcrossSessionStateReset unit test.
  • CHANGELOG.md: Updated under [Unreleased] -> Fixed.

Verification

  • Python bridge unit tests passed (38/38 tests).
  • Static prepush validation passed.
  • Live Unity Editor contract validation passed.

@Daliys
Daliys merged commit ec09740 into development Jul 28, 2026
6 checks passed
@Daliys
Daliys deleted the daliys/issue-166-auth-token-persistence branch July 28, 2026 09:07
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