2556bde8

By: Michael Lynch <git@mtlynch.io>

Make dev/prod login branching explicit, fix prod token leak

loginPost overloaded a single token-presence check to encode two unrelated
decisions: whether the email was registered, and whether to redirect to the
magic link (dev) or email it (prod). Because both dev and prod token creators
return a real token for registered users, prod fell into the redirect branch,
leaking the login token in the URL and bypassing email entirely.

Separate the two decisions:
- Handle ErrUnregisteredEmail explicitly by rendering the same confirmation
  page as a successful send, instead of subtly zeroing the entry.
- Gate the dev "redirect to magic link" behavior on an explicit build-tagged
  skipLoginEmail flag plumbed through ServerParams, so prod never redirects to
  the token.

Add TestLoginPostDoesNotLeakTokenInProdMode as a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 1s 6s 6s 8s 1s
Eval 6s 47s 47s 53s 0s
Build 11s 6m28s 1m12s 1m23s 0s
Suite 1s 7m22s 1m22s 1m23s 1s

Timeline

0s10s20s30s40s50s1m1m10s1m20s