From 7b84dafea79f36dfa3521445d9b2ea29e2813f40 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 3 Oct 2023 11:28:24 -0400 Subject: [PATCH] Correctly return on /reset submission when email isn't configured --- account.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/account.go b/account.go index ce15a41..c280a8a 100644 --- a/account.go +++ b/account.go @@ -1321,6 +1321,11 @@ func doAutomatedPasswordChange(app *App, userID int64, newPass string) error { func handleResetPasswordInit(app *App, w http.ResponseWriter, r *http.Request) error { returnLoc := impart.HTTPError{http.StatusFound, "/reset"} + if !app.cfg.Email.Enabled() { + // Email isn't configured, so there's nothing to do; send back to the reset form, where they'll get an explanation + return returnLoc + } + ip := spam.GetIP(r) alias := r.FormValue("alias")