Skip to content

feat(lr-ec2d): remove single-user mode — backend and migration (PR 1 of 3)#259

Merged
akuehner merged 1 commit into
mainfrom
feat/lr-ec2d-pr1-backend-migration
Jun 23, 2026
Merged

feat(lr-ec2d): remove single-user mode — backend and migration (PR 1 of 3)#259
akuehner merged 1 commit into
mainfrom
feat/lr-ec2d-pr1-backend-migration

Conversation

@akuehner

Copy link
Copy Markdown
Member

No description provided.

…of 3)

- Remove single-user PIN auth endpoint and all dead code (generateAuthToken,
  verifyPin, isAuthed, setAuthToken, pinPage)
- isRequestAuthed() now always delegates to isMultiUserAuthed()
- Remove all !isMultiUser() branches in server-settings.js, server-admin.js,
  server.js (404 guards, profile.json fallbacks, enable-multiuser endpoint)
- isMultiUser() retained as stub returning true in users-auth.js/users.js;
  full removal in PR 2
- daemon.js: add migrateSingleUserToMultiUser() — runs at startup, detects
  multiUser:false, creates admin stub with setupCode, atomic sync write,
  prints prominent banner with direct setup URL
- users.js: saveUsers() now writes synchronously before async store queue,
  so findUserById() reads back the user immediately after createUser()
- pages.js: remove pinPageHtml()
- test/single-user-migration.test.js: new — covers all 3 migration cases
  plus idempotency and synchronous write guarantee
- test/boot-smoke-lr-1a5f.test.js: updated for multi-user boot flow —
  pre-seeds users.json with setupCode, authenticates via /auth/setup,
  hits /info with auth cookie
- test/security.test.js: remove single-user mode test cases
- docs/specs/lr-ec2d-single-user-removal.md: full implementation spec

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@akuehner akuehner merged commit 2ad0e8e into main Jun 23, 2026
@akuehner akuehner deleted the feat/lr-ec2d-pr1-backend-migration branch June 23, 2026 00:58
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