feat: integrate authentication and password management features, including bcrypt for hashing and NextAuth for session handling
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { backupService } from "@/services/backup.service";
|
||||
import { requireAuth } from "@/lib/auth-utils";
|
||||
|
||||
export async function POST(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> | { id: string } }
|
||||
) {
|
||||
const authError = await requireAuth();
|
||||
if (authError) return authError;
|
||||
try {
|
||||
const resolvedParams = params instanceof Promise ? await params : params;
|
||||
await backupService.restoreBackup(resolvedParams.id);
|
||||
|
||||
Reference in New Issue
Block a user