Skip to content

fix: generate desktop auth secret per install - #67

Closed
hacksynth wants to merge 1 commit into
mainfrom
claude/issue-55-20260502-1628
Closed

hacksynth wants to merge 1 commit into
mainfrom
claude/issue-55-20260502-1628

Conversation

@hacksynth

Copy link
Copy Markdown
Owner

Remove shared desktop Auth.js secrets from .env.tauri; generate and reuse a per-install base64 auth secret under the Tauri app data directory, inject it into the sidecar environment, and document storage and session behavior.

Closes #55

…wner-only write

- resolve_or_create_auth_secret(): generates 32 random bytes, base64-encoded
  (44 chars), stored in auth.secret under the Tauri app data directory.
  Reuses the existing file on subsequent launches.
- write_secret_atomic(): creates a temp file (auth.secret.tmp) with 0o600
  permissions at creation time on Unix (no write-then-chmod race window),
  writes the secret, then atomically renames to auth.secret.
- Injects AUTH_SECRET and NEXTAUTH_SECRET into the sidecar process env.
- Removes hardcoded secrets from .env.tauri; adds comment directing devs
  to .env.local for tauri dev mode.
- Adds auth.secret documentation to docs/desktop-app.md: storage paths per
  platform, format, reuse across restarts, and loss/rebuild impact.

Closes #55

Co-authored-by: hacksynth <hacksynth@users.noreply.github.com>
@hacksynth

Copy link
Copy Markdown
Owner Author

Superseded by #71, which uses Claude's refreshed branch claude/issue-55-20260502-1648 and avoids the rustfmt failure on this PR.

@hacksynth hacksynth closed this May 2, 2026
@hacksynth
hacksynth deleted the claude/issue-55-20260502-1628 branch May 3, 2026 01:12
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.

.env.tauri hardcodes weak shared auth secrets

1 participant