feat: update authentication for the web app

This commit is contained in:
2026-07-11 12:58:56 +07:00
parent 9845a1702f
commit 8cd10aefdc
20 changed files with 1063 additions and 57 deletions
+3 -4
View File
@@ -1,11 +1,10 @@
import { NextResponse } from "next/server";
import { updateSettings } from "@/lib/localDb";
import { resetAdminPassword } from "@/lib/db";
// Reset dashboard password to default by clearing the stored hash.
// Local-only (enforced by dashboardGuard). Never returns the default literal.
// Reset the bootstrap administrator password. Local-only (enforced by dashboardGuard).
export async function POST() {
try {
await updateSettings({ password: null });
await resetAdminPassword(process.env.INITIAL_PASSWORD || "123456");
return NextResponse.json({ success: true });
} catch (error) {
return NextResponse.json({ error: error.message }, { status: 500 });