Repository navigation
Fix sign-in issues from the review of #38 - #41
Merged
ashutosh091 merged 4 commits intoNov 13, 2026
Merged
Conversation
From a review of erphq#38: - The limits per network count an IPv6 address by its /64. A host is usually given a whole /64, so counting each address on its own let one host ask for codes from new addresses without ever reaching the limit. - The per-address limits count codes sent. A request that sends none, because another one won the minute or the email failed, gives its count back, so a failed send no longer uses up the address's five an hour. - The request body is read a chunk at a time and refused once it passes 4 KB, instead of being read in full first when it comes without a Content-Length. - The tests that count requests in an hour or a day wait for the next window when the current one is about to end, so they can't fail by running across a window boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From a review of erphq#38: - While SIGNUP_MODE is "open", nobody waits, so the admin page lists every account as approved instead of offering to approve accounts the console already lets in. The stored status is kept, so they wait again if the waitlist comes back. - Approving an account that is already approved (two admins at once, or a second click) answers alreadyApproved, and the page says so instead of reporting that the approval email could not be sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From a review of erphq#38: when the sign-in service couldn't be asked who is signed in (a network blip, the service briefly down), the site took it as being signed out. /app, /account and /waitlist sent the reader to /login, though their session was likely fine. The session now has a fourth state, "unavailable". Those pages show "We couldn't check your sign-in." with Try again, which carries on once the service answers. Check again on the waitlist page says the service can't be reached and stays, instead of signing the reader out. Sign-in and sign-up still show their form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From a review of erphq#38: - /signup promised to open the console straight away, but a new account lands on the waitlist. It now says new accounts join the waitlist. - The note in constants/links.ts on bringing the Tally form back named a check in vite.config.ts that c5ea719 removed. It now says to put that check back too. - api/.dev.vars.example allowed http://localhost:5173, where sign-in can't work: the session cookie is SameSite=Strict on 127.0.0.1, and localhost is another site to it. The example and api/README.md now say to open the site at 127.0.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What this fixes
Fixes from a code review of #38 (sign-in and the waitlist), now on
preview. Each commit is one area:d013905Sign-in limits and the request body (api)Content-Lengthwas read in full before its size was checked. It's now read in chunks and refused past 4 KB.f4441a2The admin page shows each account's real status (api, site)SIGNUP_MODEset to"open", the admin page listed old waitlist accounts as Waiting, with Approve buttons, although the console already lets them in. They now show as approved. Their stored status is kept, so they wait again if the waitlist comes back.alreadyApproved, and the page says "…was already approved, so no email was sent."157687dA failed session check no longer signs people out (site)/app,/accountand/waitlistsent the reader to/login. Those pages now show "We couldn't check your sign-in." with Try again. "Check again" on the waitlist says the service can't be reached and stays on the page.d02a0c2Copy, a comment and the dev setup (site, api)/signupsaid you'd open the console straight away. It now says new accounts join the waitlist.site/src/constants/links.tson bringing back the Tally form named a check that Sign in with an emailed code, with a waitlist for the beta #38 had removed. It now says to restore that check too.api/.dev.vars.exampleallowedhttp://localhost:5173, where sign-in can't work, because theSameSite=Strictcookie lives on127.0.0.1. The example andapi/README.mdnow say to use127.0.0.1.After merging
The
api/changes in the first two commits take effect only once the Worker is redeployed (npm --prefix api run deploy, by someone with Cloudflare access). The site changes deploy with the preview workflow as usual.Testing
npm --prefix api run check: 57 tests, all passing. A new test covers IPv6 networks; others check that failed sends give their count back, the open-mode listing, and the already-approved answer. With the fixes undone, those tests fail.npm --prefix site run checkpasses at every commit, anddocs/matches a rebuild./app,/accountand/waitlist, Try again before and after it comes back, two admins approving the same account (one email, no false failure), and the sign-up copy🤖 Generated with Claude Code