Repository navigation
Conversation
A magic link turned on while a mail provider was configured stayed stored after the provider was removed: setEmailSettings cleared only the email verification requirement. The god form sends every setting on each save, and PUT /god/auth-settings refuses magicLink true without a provider, so the authentication page could no longer be saved. The magic-link sender also read only the stored setting, so a direct request was answered as sent while no mail could leave. setEmailSettings now clears the magic link together with the verification requirement, the rule packages/auth/AGENTS.md already states for the requirement.
grootbro
approved these changes
Oct 22, 2026
grootbro
left a comment
Contributor
There was a problem hiding this comment.
Reviewed all four changed files at 9236a7e. Clearing both mail-dependent flags when the last provider is removed matches the existing verification-setting invariant; the auth-settings refetch keeps the god form in sync.
I checked the exact-head CI run 39731429095 and its test log: both new magic-link-without-a-provider regressions pass, including the refused link request and the subsequent full auth-settings save. Build, quality checks and CodeQL are green. No findings from this source review. I did not run a separate local or live-instance test.
Merged
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
Removing the email provider now turns the sign-in links (
magicLink) off along with the email confirmation requirement. The god authentication page saves again after the provider is removed, and a magic-link request is refused instead of being answered as sent.Why
Closes #665
setEmailSettingscleared onlyrequireEmailVerificationwhen the provider was removed, so a magic link turned on before stayed stored as on:PUT /god/auth-settingsrefusesmagicLink: truewithout a provider, so every save of the page answered "Configure an email provider first". The switch is disabled without a provider, so it could not be turned off either./auth-confighides the link from the sign-in page, but a directPOST /api/auth/sign-in/magic-linkwas answered as sent while the mail was dropped.packages/auth/AGENTS.mdalready states the rule for the confirmation requirement: it never outlives the mail provider, so the stored setting is all its readers check. The sign-in links now follow it, and the paragraph says so. Turning the provider on again leaves both off until they are turned on, as the requirement already does.An instance already in this state is repaired by saving the email settings once.
How to test
Tests, in
god-email-verification.test.ts:What it covers in each form of the app:
Full battery on this branch: api 2479, bot 4, worker 205, web 429 tests pass.
Checklist
bun run typecheckpassesbun run lintandbun run format:checkpassbun run db:generateand committed (not applicable).env.example(not applicable)README.mdor the relevantAGENTS.md):packages/auth/AGENTS.mdScreenshots
Not applicable: no screen changes.
A note on how this was made
This change was vibe coded. I'm sharing it because I have been using it
extensively in my own self-hosted deployment, and it may be useful to others too.