Some improvements

This commit is contained in:
Louis Lam 2022-03-29 17:38:48 +08:00
parent 12237dec6e
commit 0da6e6b1fb
8 changed files with 188 additions and 71 deletions

View file

@ -12,6 +12,10 @@ const { loginRateLimiter } = require("./rate-limiter");
* @returns {Promise<Bean|null>}
*/
exports.login = async function (username, password) {
if (typeof username !== "string" || typeof password !== "string") {
return null;
}
let user = await R.findOne("user", " username = ? AND active = 1 ", [
username,
]);