Repository navigation
Local dev sign-in replaces LOCAL_DEV_LOGIN - #2
Open
Ethan-Arrowood wants to merge 1 commit into
Open
Ethan-Arrowood wants to merge 1 commit into
Ethan-Arrowood wants to merge 1 commit into
Conversation
LOCAL_DEV_LOGIN made every request one synthetic admin, so attendee vs.
admin, two people racing for a task, and bans couldn't be tried locally.
Dev sign-in signs the session in as any test user, the same way the GitHub
OAuth plugin does (session.update({ user })), so the rest of the app can't
tell the difference:
- POST /api/dev/login { as } signs in (or switches); an unknown login is
created as a plain attendee. GET /api/dev/users lists who you can be.
Sign-out is the existing POST /oauth/logout. It's a POST because the SSR
handler claims every browser navigation outside /oauth.
- A Dev menu in the nav (DevSignInMenu) picks or switches users. /api/me
reports devSignIn: true only when it's on, so production makes no extra
request.
- Off unless LOCAL_DEV_SIGN_IN=true on a local instance (shared/local.ts),
and only for logins with an underscore, which GitHub usernames can't
have: even enabled in the wrong place it can never act as a real
account. When off, the routes aren't registered.
- LOCAL_DEV_LOGIN and the local-dev user are gone; setting it now logs a
warning pointing at LOCAL_DEV_SIGN_IN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Second of three PRs: fixtures + seed (#1) → dev sign-in + guard → API tests in CI.
Stacked on #1 (it reuses #1's
isLocalInstance()). Once #1 merges, this retargets tomain.Why
LOCAL_DEV_LOGINmade every request one synthetic admin. That meant you couldn't try attendee vs. admin, two people racing for a task, or bans, and one misplaced env var made every visitor an admin.What
POST /api/dev/login { "as": "fx_alice" }signs the session in as that user, the same way the GitHub OAuth plugin does (session.update({ user })). The rest of the app can't tell the difference.GET /api/dev/userslists who you can sign in as.POST /oauth/logout./api/mereportsdevSignIn: trueonly when it's on, so production makes no extra request.LOCAL_DEV_SIGN_IN=trueand the instance is local (OAUTH_REDIRECT_URIunset or loopback);LOCAL_DEV_LOGINand thelocal-devuser are removed. Setting it now logs a warning pointing atLOCAL_DEV_SIGN_IN..env.example,fixtures/README.md.It's a
POSTrather than a link because the SSR handler claims every browser navigation outside/oauth. AGETfrom the address bar would render the app's 404 page instead of reaching the API.Verified on a local Harper 5.2 with fixtures
fx_aliceand switch tofx_adain the same session; the admin route returns 403 then 200;fx_carolcan sign in but can't claim;fx_zedis created as an attendee and can claim;ethan-arrowood→ 400;GET /api/dev/logindoesn't sign in;fx_alice, switching tofx_adashows the Admin nav link, and Sign out returns the nav to "Sign in as…".OAUTH_REDIRECT_URI=https://example.com/...): logsLOCAL_DEV_SIGN_IN ignored, dev routes 404, nodevSignInflag. Not set: the same 404s.LOCAL_DEV_LOGIN=truelogs the replacement warning and grants nothing.Found while testing (not changed here)
npm run devnever hydrates on a fresh install, onmaintoo. The Vite dev server servesclassnamesunbundled (does not provide an export named 'default'). Production builds are fine..claude/worktrees/….@harperfast/vite's build at once, each emptyingdist/. That churn likely explains the missingentry-server.jsafter production deploys.🤖 Generated with Claude Code