Summary
With enable_local_logins_via_code on and allowed_email_domains set, signing up with an email whose domain is not on the allowed list takes the visitor to the “check your email, enter the 6-digit code” screen — but no code is ever generated or sent. The visitor is stuck at a dead end with no explanation, and nothing shows up in the admin email logs.
Steps to reproduce
- Set
allowed_email_domainsto a list that does not include the test domain, e.g.qq.com|gmail.com|163.com. - Enable
enable_local_logins_via_codeandenable_local_logins_via_email. - As a logged-out visitor, open
/signupand enter an email with a disallowed domain (e.g.www@imlotso.com). - Submit. The UI advances to the code entry screen saying a 6-digit code was sent.
Actual result
No code is generated, no email is sent, and nothing appears in Admin → Emails → Sent or Skipped. The user waits for a code that will never arrive.
Expected result
The email step should reject the domain up front — the classic password signup flow does this via User.checkEmail, which returns the “email not allowed” error inline. At minimum the code screen should not claim a code was sent when none was.
What I found in the code (self-hosted, version 2026.12.0-latest, revision b69b9c02)
app/services/email_login_code/request.rb:deliverable?returns false whenEmailValidator.allowed?(email)is false, so the code is never generated andsend_login_code_emailnever runs. The domain check itself works.app/controllers/session_controller.rb(create_login_code): the action deliberately always renderssuccess_json, with the comment “Render the same response as a successful request so bots can’t probe the endpoint.”- So the frontend cannot distinguish “code sent” from “refused”, and advances to the code screen in both cases.
Suggestion
Validate the domain at the email step of the code-signup form (the password flow already surfaces this error), or make the code screen copy neutral for the not-sent case.