add admin account recovery via setup secret
All checks were successful
deploy / deploy (push) Successful in 1m33s

When email isn't configured, the login page now hides the magic link
form and shows a recovery link. The /recover page logs the setup secret
to server logs and lets the admin reset their password with it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-21 21:40:53 +00:00
parent 194fec8240
commit b0607621f3
7 changed files with 343 additions and 25 deletions

View File

@@ -146,12 +146,14 @@ defmodule BerrypodWeb.Router do
scope "/", BerrypodWeb do
pipe_through [:browser]
# Token-based auto-login after setup account creation
# Token-based auto-login after setup/recovery
get "/setup/login/:token", SetupController, :login
get "/recover/login/:token", SetupController, :recover_login
live_session :setup,
on_mount: [{BerrypodWeb.UserAuth, :mount_current_scope}] do
live "/setup", Setup.Onboarding, :index
live "/recover", Setup.Recover, :index
end
end