feat: add validation for login

This commit is contained in:
wancat committed 2023-11-01 21:35:25 +08:00
1 parent fc6ac11c60
commit 203114cd5e
6 files changed
+44 -24

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ async function verifyPassword(username, password, done) {
$or: [{ username }, { email: username }],
})
if (!user) {
return done(null, false, { message: 'Incorrect username.' })
return done(null, false, { message: 'Incorrect username or password.' })
}
const isPasswordValid = await bcrypt.compare(password, user.hashedPassword)