Fix indentation and remove unused hash login method

This commit is contained in:
SrGooglo 2025-04-24 06:09:58 +00:00
parent f0f612942a
commit 3268cb819a

View File

@ -18,15 +18,9 @@ export default async ({ username, password, hash }, user) => {
throw new OperationError(401, "User is disabled")
}
if (typeof hash !== "undefined") {
if (user.password !== hash) {
throw new OperationError(401, "Invalid credentials")
}
} else {
if (!bcrypt.compareSync(password, user.password)) {
throw new OperationError(401, "Invalid credentials")
}
}
return user
}