Browse Source

Merge pull request #1819 from slingamn/password_message

fix error message for NS SET EMAIL without the password
tags/v2.8.0
Shivaram Lingamneni 2 years ago
parent
commit
4a3ac617a5
No account linked to committer's email address
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      irc/nickserv.go

+ 6
- 2
irc/nickserv.go View File

@@ -1130,8 +1130,12 @@ func nsConfirmPassword(server *Server, account, passphrase string) (errorMessage
1130 1130
 		errorMessage = `You're not logged into an account`
1131 1131
 	} else {
1132 1132
 		hash := accountData.Credentials.PassphraseHash
1133
-		if hash != nil && passwd.CompareHashAndPassword(hash, []byte(passphrase)) != nil {
1134
-			errorMessage = `Password incorrect`
1133
+		if hash != nil {
1134
+			if passphrase == "" {
1135
+				errorMessage = `You must supply a password`
1136
+			} else if passwd.CompareHashAndPassword(hash, []byte(passphrase)) != nil {
1137
+				errorMessage = `Password incorrect`
1138
+			}
1135 1139
 		}
1136 1140
 	}
1137 1141
 	return

Loading…
Cancel
Save