Repository navigation
E-mail verification, forgot/reset password and Sign in with Google (secure rewrite) - #20
Merged
Merged
Conversation
Rewrites the account flows with secure defaults; all three are off until switched on under Settings -> Accounts & e-mail. - One-time links: 32 random bytes, only the SHA-256 hash is stored, single use (atomic UPDATE), reset links live 1 hour, confirmation links 3 days. - Verification is enforced at login (after the password is right), never logs anybody in, and the link needs a POST so mail scanners cannot use it. - Forgot password answers the same for known and unknown addresses and is rate limited per IP and per address; Turnstile applies. - Google: authorization code + PKCE + state + nonce, single-use sign-in session, only Google-verified addresses, safe account linking. - Mail config comes from .env (mail/smtp/sendmail/log) with a mailtest console command; `console prune` removes old tokens. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYbe92Bns1mKdy23b7txT8
2 of 3 tasks
With no (or an unreachable) database, /forgot-password and /google/* answered 500 instead of 404: the controllers loaded the user model, which opens the database, in their constructors. They now check the setting first and load the database pieces only after that. A verification link opened after the feature was switched off says "link not valid" instead of failing. Found by the PHPUnit smoke test in CI. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYbe92Bns1mKdy23b7txT8
…tion Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYbe92Bns1mKdy23b7txT8
godzam
marked this pull request as ready for review
November 1, 2026 05:34
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.
Summary
Replaces the broken account features from the
freebuff/…branch (parse error inapp_settings.php, a migration calling a method CodeIgniter does not have, OAuthstatenever sent, guessablemd5(uniqid())tokens, verification never enforced, views/routes that did not exist) with a rewrite. All three features are off by default (Settings → Accounts & e-mail).UPDATE … WHERE used_at IS NULL), reset 1 h / confirm 3 days. New migration20261008000000_add_account_security(users.email_verified_at,users.google_sub,user_tokens); existing users count as confirmed.turnstile_on_forgot), no automatic login afterwards,no-store+Referrer-Policy: no-referrer.state+nonce, single-use 10-minute sign-in session, ID token checked (client, issuer, expiry, nonce, Google-verified e-mail), safe linking (an unconfirmed local account has its password replaced), respects login blocks. The button is a plain link (no inline script, so the production CSP is kept)..env(mail/smtp/sendmail/log;logis development-only),php index.php console mailtest,console pruneremoves old tokens. No credentials in the repo.Test plan
mail()delivery, real Google, MySQL 8.4 and real PHPUnit: only in CI / not run locallyGenerated by Claude Code