fixed a bit

This commit is contained in:
bobbert committed 2025-03-12 01:46:32 +00:00
1 parent 25fe268ed6
commit c62413eafa
4 files changed
+60

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { queryOne } from "@/lib/db";
import bcrypt from "bcryptjs";
export async function validateCredentials(username, password) {
const user = await queryOne("SELECT * FROM users WHERE username = ?", [
username,
]);
if (user && bcrypt.compareSync(password, user.password)) {
return {
id: user.id,
username: user.username,
role: user.role,
teamId: user.team_id,
};
}
return null;
}