Skip to content

Commit bc88c20

Browse files
authored
Merge pull request #3897 from Nixxx19/nityam/fix-bcrypt-compare-async-3878
Fix: use async bcrypt in findMatchingKey #3878
2 parents 225222b + 903df16 commit bc88c20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/models/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ userSchema.methods.findMatchingKey = async function findMatchingKey(
172172
for (const k of this.apiKeys) {
173173
try {
174174
/* eslint-disable no-await-in-loop */
175-
const foundOne = await bcrypt.compareSync(candidateKey, k.hashedKey);
175+
const foundOne = await bcrypt.compare(candidateKey, k.hashedKey);
176176

177177
if (foundOne) {
178178
keyObj = { isMatch: true, keyDocument: k };

0 commit comments

Comments
 (0)