chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier

This commit is contained in:
Julien Froidefond
2025-12-01 08:37:30 +01:00
parent 757b1b84ab
commit e715779de7
98 changed files with 5453 additions and 3126 deletions

View File

@@ -4,4 +4,3 @@ import { authOptions } from "@/lib/auth";
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };

View File

@@ -10,7 +10,7 @@ export async function POST(request: NextRequest) {
if (!session) {
return NextResponse.json(
{ success: false, error: "Non authentifié" },
{ status: 401 }
{ status: 401 },
);
}
@@ -20,23 +20,26 @@ export async function POST(request: NextRequest) {
if (!oldPassword || !newPassword) {
return NextResponse.json(
{ success: false, error: "Mot de passe requis" },
{ status: 400 }
{ status: 400 },
);
}
if (newPassword.length < 4) {
return NextResponse.json(
{ success: false, error: "Le mot de passe doit contenir au moins 4 caractères" },
{ status: 400 }
{
success: false,
error: "Le mot de passe doit contenir au moins 4 caractères",
},
{ status: 400 },
);
}
const result = await authService.changePassword(oldPassword, newPassword);
if (!result.success) {
return NextResponse.json(
{ success: false, error: result.error },
{ status: 400 }
{ status: 400 },
);
}
@@ -45,8 +48,7 @@ export async function POST(request: NextRequest) {
console.error("Error changing password:", error);
return NextResponse.json(
{ success: false, error: "Erreur lors du changement de mot de passe" },
{ status: 500 }
{ status: 500 },
);
}
}