update promo
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user