Skip to content

Commit cd1e36c

Browse files
committed
return false instead of throwing error at comparePassword
1 parent 6f3f5c7 commit cd1e36c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/models/user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ userSchema.methods.comparePassword = async function comparePassword(
163163
candidatePassword
164164
) {
165165
if (!this.password) {
166-
throw new Error('No password is set for this user.');
166+
console.error('No password is set for this user.');
167+
return false;
167168
}
168169

169170
try {

0 commit comments

Comments
 (0)