From fd97539f85da69412e98d1a534f35fbb8b466268 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 22 Apr 2020 09:26:42 -0400 Subject: [PATCH] Mention unset password on failed login (when it applies) --- account.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account.go b/account.go index f3399e4..56a4f84 100644 --- a/account.go +++ b/account.go @@ -489,6 +489,9 @@ func login(app *App, w http.ResponseWriter, r *http.Request) error { return impart.HTTPError{http.StatusPreconditionFailed, "This user never added a password or email address. Please contact us for help."} } } + if len(u.HashedPass) == 0 { + return impart.HTTPError{http.StatusUnauthorized, "This user never set a password. Perhaps try logging in via OAuth?"} + } if !auth.Authenticated(u.HashedPass, []byte(signin.Pass)) { return impart.HTTPError{http.StatusUnauthorized, "Incorrect password."} }