Repository navigation
fix(login): say so when the install has no email provider (#3655) - #3756
Merged
Merged
Conversation
With no email provider configured (the default for a localhost install that skipped the Resend key) the sender falls back to console mode: the code goes to the backend log and the send reports success. The Login page still said "We sent a 6-digit code", and the person waited for an email that never came. GET /api/auth/mode now carries email_delivery_available, an install-level flag like email_code_login_enabled, from EmailService.can_deliver(): false for console, an unknown provider, or a provider missing its key or SMTP settings; true on an unreadable config, so the page behaves as today. When it is false, step 2 says no email was sent, that a code for an address allowed to sign in is in the backend log (docker compose logs backend), and points at Admin Login and Settings -> Integrations. The wording is conditional because the request endpoint answers the same for every address (#186) and never consults the flag. The code itself is never rendered. FAQ entry added. Fixes #3655 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.
Summary
GET /api/auth/modenow carriesemail_delivery_available. It's an install-level flag, like ent#849'semail_code_login_enabled, computed byEmailService.can_deliver():falseforconsole, an unknown provider,resendwithout a key (Settings or env),smtpwithout host/user/password, orsendgridwithout a key;trueif the config can't be read, so the page then behaves exactly as today.docker compose logs backend;POST /api/auth/email/requestanswers the same for every address (SEC: User and Agent Enumeration via differential API responses #186), so the page can't claim a code exists. That endpoint never consults the flag (pinned by an AST test). The code itself is never rendered.Changes
src/backend/services/email_service.py:can_deliver().src/backend/routers/auth.py:email_delivery_availableon/api/auth/mode.src/frontend/src/stores/auth.js:emailDeliveryAvailable(nullor an older backend reads as "delivers").src/frontend/src/views/Login.vue: the notice, usingstatus-warningtokens andBaseButton, and auseAdminLoginhandler.tests/unit/test_3655_email_delivery_flag.py: providers and keys, unreadable config, the mode flag, and the request handler never reading it. 8 fail and 2 error without the fix.loginNoEmailProvider.spec.js: the copy, no six-digit number rendered, the Admin Login button, unchanged behaviour when email is delivered, and the store reading the flag.docs/user-docs/faq/getting-started.md.Tested against a local instance
Provider
console, no Resend key. This branch's four files were hot-swapped into the running stack and restored afterwards. A signed-out browser requested a code for a non-whitelisted address:/api/auth/modereturnsemail_delivery_available: false, and the notice shows in both light and dark.Screenshots were shared with the reviewer separately (not committed).
Test Plan
test_3655_email_delivery_flag.py+test_ent849_email_code_policy.py+test_verification_email.py: 58 passed.rawColorRatchet.spec.js: 29 passed. The colour ratchet holds: no raw palette classes added.Fixes #3655
🤖 Generated with Claude Code