owner_reset_hex.go: check for SMTP configuration before queries

This commit is contained in:
Adhityaa 2018-06-09 15:19:15 +05:30
parent 130ee48e7e
commit 5fe785f2fd

View File

@ -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