reboot alterflixhub

This commit is contained in:
Bkk1234 committed 2026-11-01 17:24:44 +07:00
commit 1e84023a44
188 files changed
+31629

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import { createError, defineEventHandler, readBody } from "h3";
import { createAdminSession, isValidCredentials } from "@/lib/admin-auth.server";
export default defineEventHandler(async (event) => {
const body = (await readBody(event)) as {
username?: string;
password?: string;
};
const username = (body?.username ?? "").trim();
const password = body?.password ?? "";
if (!isValidCredentials(username, password)) {
throw createError({
statusCode: 401,
statusMessage: "ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง",
});
}
createAdminSession(event);
return { ok: true };
});