feat: integrate authentication and password management features, including bcrypt for hashing and NextAuth for session handling

This commit is contained in:
Julien Froidefond
2025-11-30 08:04:06 +01:00
parent 7cb1d5f433
commit d663fbcbd0
30 changed files with 3287 additions and 4164 deletions

View File

@@ -1,7 +1,10 @@
import { NextRequest, NextResponse } from "next/server";
import { backupService } from "@/services/backup.service";
import { requireAuth } from "@/lib/auth-utils";
export async function GET() {
const authError = await requireAuth();
if (authError) return authError;
try {
const settings = await backupService.getSettings();
return NextResponse.json({ success: true, data: settings });
@@ -15,6 +18,9 @@ export async function GET() {
}
export async function PUT(request: NextRequest) {
const authError = await requireAuth();
if (authError) return authError;
try {
const body = await request.json();
const settings = await backupService.updateSettings(body);