Skip to content

Commit

Permalink
try revert
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjford committed Aug 2, 2019
1 parent 799214c commit 9d3bf06
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/models/AccountModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const AccountModel = {
status: "Not Found", message: "Account not found for provided email"};
}

if (!validPassword(user, req.body.password)) {
const passwordIsCorrect = bcrypt.compareSync(req.body.password, user.password);
if (!passwordIsCorrect) {
return {status: "Unauthorized", message: "Password not valid"};
}

Expand All @@ -35,10 +36,6 @@ const AccountModel = {
};
},

async validPassword(user, password) {
return bcrypt.compareSync(password, user.password);
},

async validateAccount(req) {
const query = `SELECT v.*, a.*
FROM verification_tokens v
Expand Down

0 comments on commit 9d3bf06

Please sign in to comment.