mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
feat: update authentication for the web app
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user