Enforce semicolon, fix format globally

This commit is contained in:
Louis Lam
2022-04-14 00:30:32 +08:00
parent 6f72ca481f
commit 649f3106e1
50 changed files with 184 additions and 198 deletions

View File

@@ -4,20 +4,20 @@ const saltRounds = 10;
exports.generate = function (password) {
return bcrypt.hashSync(password, saltRounds);
}
};
exports.verify = function (password, hash) {
if (isSHA1(hash)) {
return passwordHashOld.verify(password, hash)
return passwordHashOld.verify(password, hash);
}
return bcrypt.compareSync(password, hash);
}
};
function isSHA1(hash) {
return (typeof hash === "string" && hash.startsWith("sha1"))
return (typeof hash === "string" && hash.startsWith("sha1"));
}
exports.needRehash = function (hash) {
return isSHA1(hash);
}
};