Public: anyone can read this; the crew can change it.
An edge sign-in for someone with no forge account creates nothing and goes to the forge's own signup #2599
An edge sign-in no longer creates an account. A login with no account here is treated as signed out and offered /signup. The full bun test run didn't finish in the sandbox, so I ran only the suites that touch edge sign-in and accounts.
stopped parked by the crew deploy 6e597ae
2 earlier comments
An edge sign-in no longer creates an account. A login with no account here is treated as signed out and offered /signup. The full bun test run didn't finish in the sandbox, so I ran only the suites that touch edge sign-in and accounts. Those pass, and tsc --noEmit is clean.
What changed
ensureEdgeUserinsrc/core/users.tsnow only finds an existing active user by name and returns undefined otherwise. I dropped its unusedhostargument.resolveAuthinsrc/http/server.tsno longer creates accounts or records theuser.createdevent withvia: "edge". A stranger's request is signed out and markededgeStranger(new field onAuth).- For such a request, the header button reads "Sign up" and goes to
/signup, instead of looping back to the edge login./signupapplies thesignupsetting and its checks as for anyone, and shows "Signup is closed on this forge." when closed. - The sign-up page's edge text said the edge "makes your account on first sight"; it now says the edge doesn't make an account here.
- Accounts the edge already made still sign in by name, as before.
Tests
- In
test/edge-auth.test.ts, an unknown edge login makes no user row, gets 401, and sees "Sign up" with no "Sign out". An account made earlier with originedgestill signs in and is not an admin. - In
test/signup-closed.test.tsandtest/signup.test.ts, an unknown edge login is still refused while signup is closed. It is also refused after signup reopens, and an existing account still signs in in both states. - I rewrote tests that assumed the edge makes accounts:
no-signup-admin,reserved-names, andaccounts. Inaccountsthey now create the account directly and add theuser.createdevent by hand. - I deleted two tests that only checked behaviour that no longer exists: "an account the edge makes is audited too" in
accounts, and "an account the edge makes must prove an address too" inverify-email.
Left out
- The
origin: "edge"variant increateUserstays, because existing accounts and these tests still use it. Removing it is a separate cleanup. - The full suite wasn't run to completion, so the forge's check on this push is the first full run.
Try it
Start the forge with an edge token. Request / with x-plat-user: nobody and the matching x-plat-edge-token header. The page shows "Sign up" and GET /api/v1/user returns 401. Neither request adds a user row.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. The only conflict was the header's sign-in area in src/web/layout.ts.
- Conflict fix:
mainadded a guest menu in front of the Sign in button. This branch swaps that button for "Sign up" when an edge sign-in finds no account. The merged header keeps both. A guest sees the menu, then "Sign up" if they are an edge stranger and "Sign in" otherwise. - Tests:
test/accounts.test.tspasses (21 tests). The type check printed nothing, which I read as clean. I never saw a result from the fullbun testrun. The first two attempts printed nothing and a third timed out. I did not run the guest, edge-auth or sign-in suites by name. The forge's check on this push will run the whole suite.
🤖 Generated with Claude Code
Parked by the crew: the check stayed red through 2 automatic tries
An edge sign-in no longer creates an account. A login with no account here is treated as signed out and offered
/signup. The fullbun testrun didn't finish in the sandbox, so I ran only the suites that touch edge sign-in and accounts. Those pass, andtsc --noEmitis clean.What changed
ensureEdgeUserinsrc/core/users.tsnow only finds an existing active user by name and returns undefined otherwise. I dropped its unusedhostargument.resolveAuthinsrc/http/server.tsno longer creates accounts or records theuser.createdevent withvia: "edge". A stranger's request is signed out and markededgeStranger(new field onAuth)./signup, instead of looping back to the edge login./signupapplies thesignupsetting and its checks as for anyone, and shows "Signup is closed on this forge." when closed.Tests
test/edge-auth.test.ts, an unknown edge login makes no user row, gets 401, and sees "Sign up" with no "Sign out". An account made earlier with originedgestill signs in and is not an admin.test/signup-closed.test.tsandtest/signup.test.ts, an unknown edge login is still refused while signup is closed. It is also refused after signup reopens, and an existing account still signs in in both states.no-signup-admin,reserved-names, andaccounts. Inaccountsthey now create the account directly and add theuser.createdevent by hand.accounts, and "an account the edge makes must prove an address too" inverify-email.Left out
origin: "edge"variant increateUserstays, because existing accounts and these tests still use it. Removing it is a separate cleanup.Try it Start the forge with an edge token. Request
/withx-plat-user: nobodyand the matchingx-plat-edge-tokenheader. The page shows "Sign up" andGET /api/v1/userreturns 401. Neither request adds a user row.🤖 Generated with Claude Code
Closes #2593