Deny access for empty password authentication attempts
This commit is contained in:
parent
67fc7939df
commit
2c387351c6
1 changed files with 4 additions and 0 deletions
|
@ -116,6 +116,10 @@ module.exports.add = (username, password, email, callback) => {
|
|||
*/
|
||||
module.exports.authenticate = (username, password, callback) => {
|
||||
|
||||
if (password === '') {
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
let login = (connection, callback) => {
|
||||
connection.query('SELECT `id`, `password`, `access_token` FROM `users` WHERE `username`=? OR email=? LIMIT 1', [username, username], (err, rows) => {
|
||||
if (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue