update promo

This commit is contained in:
2026-08-25 10:56:46 +07:00
parent d8e4e8a502
commit a61f3c1f23
24 changed files with 697 additions and 134 deletions
+1 -12
View File
@@ -55,17 +55,6 @@ export default async function (req: Request): Promise<Response> {
apiKey: Deno.env.get("INSFORGE_API_KEY")!,
});
const { count } = await admin.database
.from("app_users")
.select("id", { count: "exact", head: true });
if ((count ?? 0) > 0) {
return new Response(
JSON.stringify({ error: "Akun admin sudah dibuat. Pendaftaran ditutup." }),
{ status: 403, headers: { ...corsHeaders, "Content-Type": "application/json" } }
);
}
const { data: existing } = await admin.database
.from("app_users")
.select("id")
@@ -84,7 +73,7 @@ export default async function (req: Request): Promise<Response> {
const hash = await sha256Hex(`${salt}|${password}|${pepper}`);
const { error } = await admin.database.from("app_users").insert([
{ username: username.trim(), password_hash: hash, salt },
{ username: username.trim(), password_hash: hash, salt, approved: false },
]);
if (error) {