From 5fe785f2fd9faba2515247bac9d8f8a052ea21a5 Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Sat, 9 Jun 2018 15:19:15 +0530 Subject: [PATCH] owner_reset_hex.go: check for SMTP configuration before queries --- api/owner_reset_hex.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/owner_reset_hex.go b/api/owner_reset_hex.go index c2bf339..ebe4add 100644 --- a/api/owner_reset_hex.go +++ b/api/owner_reset_hex.go @@ -10,6 +10,10 @@ func ownerSendResetHex(email string) error { return errorMissingField } + if !smtpConfigured { + return errorSmtpNotConfigured + } + o, err := ownerGetByEmail(email) if err != nil { if err == errorNoSuchEmail { @@ -22,10 +26,6 @@ func ownerSendResetHex(email string) error { } } - if !smtpConfigured { - return errorSmtpNotConfigured - } - resetHex, err := randomHex(32) if err != nil { return err