fix(auth): magic-link email crashes in prod (:noproc), so nobody without OIDC can log in #10

Closed
opened 2026-11-01 16:49:00 +00:00 by jfro · 0 comments
Owner

config/prod.exs sets config :swoosh, local: false but keeps config.exs's Swoosh.Adapters.Local, and runtime.exs configures no mailer. Registering (user_live/registration.ex:62) or "email me a link" exits with :noproc; without OIDC nobody can ever log in.

Also: the login page shows the dev "/dev/mailbox" banner in prod (user_live/login.ex:31,157) linking to a 404, and the sender is contact@example.com (accounts/user_notifier.ex:13).

Fix:

  • Configure a real mailer from env vars in runtime.exs (adapter TBD with Jeremy; share it with #5's email channel); MAIL_FROM for the sender.
  • Hide the mailbox banner unless dev_routes is on.
  • If no mailer is configured, fail clearly (log + flash) instead of crashing.

Regression test: Nye's test/audit/prod_mailer_test.exs (proof F1).

Found in the pre-1.0 gap audit of main @ 69e09f0.

config/prod.exs sets `config :swoosh, local: false` but keeps config.exs's `Swoosh.Adapters.Local`, and runtime.exs configures no mailer. Registering (user_live/registration.ex:62) or "email me a link" exits with `:noproc`; without OIDC nobody can ever log in. Also: the login page shows the dev "/dev/mailbox" banner in prod (user_live/login.ex:31,157) linking to a 404, and the sender is contact@example.com (accounts/user_notifier.ex:13). Fix: - Configure a real mailer from env vars in runtime.exs (adapter TBD with Jeremy; share it with #5's email channel); MAIL_FROM for the sender. - Hide the mailbox banner unless `dev_routes` is on. - If no mailer is configured, fail clearly (log + flash) instead of crashing. Regression test: Nye's test/audit/prod_mailer_test.exs (proof F1). Found in the pre-1.0 gap audit of main @ 69e09f0.
jfro added this to the v1.0 milestone 2026-11-01 16:49:00 +00:00
jfro closed this issue 2026-11-01 17:44:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/lamplighter#10
No description provided.