mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-23 17:00:24 +01:00
change isPasswordCorrect to return false if user does not have password
This commit is contained in:
@@ -303,6 +303,19 @@ describe('authentication', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should fail to login if user does not have password field in db', function (done) {
|
||||
user.create({ username: 'hasnopassword', email: 'no@pass.org' }, function (err, uid) {
|
||||
assert.ifError(err);
|
||||
loginUser('hasnopassword', 'doesntmatter', function (err, response, body) {
|
||||
assert.ifError(err);
|
||||
console.log(response.statusCode, body);
|
||||
assert.equal(response.statusCode, 403);
|
||||
assert.equal(body, '[[error:invalid-login-credentials]]');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should fail to login if password is longer than 4096', function (done) {
|
||||
var longPassword;
|
||||
for (var i = 0; i < 5000; i++) {
|
||||
|
||||
Reference in New Issue
Block a user