import Bun from 'bun'; import { User, get_user_by_name } from "$lib/server/database"; export async function authorize_password(username: string, password: string): Promise { const user = get_user_by_name(username); const password_hash = user?.password ?? ""; const res = await Bun.password.verify(password, password_hash, "bcrypt"); return res ? user : null; }