This commit is contained in:
Lukas F. Hartmann
2018-05-01 17:06:29 +02:00
16 changed files with 16610 additions and 154 deletions

View File

@@ -25,7 +25,10 @@ router.post('/', function(req, res) {
res.sendStatus(404);
})
.then(user => {
if (bcrypt.compareSync(password, user.password_hash)) {
if (!user) {
res.sendStatus(404);
}
else if (bcrypt.compareSync(password, user.password_hash)) {
crypto.randomBytes(48, function(ex, buf) {
var token = buf.toString('hex');