Skip to content

Commit 3b270ed

Browse files
committed
Don't specify whether user or password failed.
Stops us potentially leaking valid username info.
1 parent 3dc7ef0 commit 3b270ed

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

auth/strategies.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ const basicStrategy = new BasicStrategy((username, password, callback) => {
1919
if (!user) {
2020
return Promise.reject({
2121
reason: 'LoginError',
22-
message: 'Incorrect username',
23-
location: 'username'
22+
message: 'Incorrect username or password',
2423
});
2524
}
2625
return user.validatePassword(password);
@@ -29,8 +28,7 @@ const basicStrategy = new BasicStrategy((username, password, callback) => {
2928
if (!isValid) {
3029
return Promise.reject({
3130
reason: 'LoginError',
32-
message: 'Incorrect password',
33-
location: 'password'
31+
message: 'Incorrect username or password',
3432
});
3533
}
3634
return callback(null, user)

0 commit comments

Comments
 (0)