fix error message for NS SET EMAIL without the password

This commit is contained in:
Shivaram Lingamneni
2021-11-04 20:10:56 -04:00
parent 2274ef3fa0
commit 9f0c3cdc0e
+6 -2
View File
@@ -1130,8 +1130,12 @@ func nsConfirmPassword(server *Server, account, passphrase string) (errorMessage
errorMessage = `You're not logged into an account`
} else {
hash := accountData.Credentials.PassphraseHash
if hash != nil && passwd.CompareHashAndPassword(hash, []byte(passphrase)) != nil {
errorMessage = `Password incorrect`
if hash != nil {
if passphrase == "" {
errorMessage = `You must supply a password`
} else if passwd.CompareHashAndPassword(hash, []byte(passphrase)) != nil {
errorMessage = `Password incorrect`
}
}
}
return