feat: enhance user login functionality by adding 'remember me' option for cookie persistence

This commit is contained in:
Julien Froidefond
2025-10-16 14:47:55 +02:00
parent 4209557768
commit ef4de29282
2 changed files with 4 additions and 4 deletions

View File

@@ -7,11 +7,11 @@ import { getErrorMessage } from "@/utils/errors";
import type { NextRequest } from "next/server";
export async function POST(request: NextRequest) {
try {
const { email, password } = await request.json();
const { email, password, remember } = await request.json();
try {
const userData: UserData = await AuthServerService.loginUser(email, password);
await AuthServerService.setUserCookie(userData);
await AuthServerService.setUserCookie(userData, remember);
return NextResponse.json({
message: "✅ Connexion réussie",