summaryrefslogtreecommitdiff
path: root/lib/web/auth
diff options
context:
space:
mode:
authorClaudius2019-05-14 14:43:31 +0200
committerClaudius2019-05-14 14:43:31 +0200
commit4c90863f2cd8499bcb3759cb39f8a1040488d258 (patch)
tree8d78d91b55b1dc791df4611bb49813fe01ff9574 /lib/web/auth
parentdabcb91185488703dca6bce30cfea5c968694fd9 (diff)
parent1da5a5bcccf7ce1e2f88ef501619f40ccb689220 (diff)
Merge branch 'feature/drop-node-6'
Diffstat (limited to '')
-rw-r--r--lib/web/auth/email/index.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/web/auth/email/index.js b/lib/web/auth/email/index.js
index f7e58d46..daa4a8c5 100644
--- a/lib/web/auth/email/index.js
+++ b/lib/web/auth/email/index.js
@@ -23,8 +23,14 @@ passport.use(new LocalStrategy({
}
}).then(function (user) {
if (!user) return done(null, false)
- if (!user.verifyPassword(password)) return done(null, false)
- return done(null, user)
+ user.verifyPassword(password).then(verified => {
+ if (verified) {
+ return done(null, user)
+ } else {
+ logger.warn('invalid password given for %s', user.email)
+ return done(null, false)
+ }
+ })
}).catch(function (err) {
logger.error(err)
return done(err)