feat(auth): password strongest + docs

This commit is contained in:
Julien Froidefond
2025-02-22 16:04:28 +01:00
parent 66461ff32a
commit 880b97d42d
4 changed files with 290 additions and 25 deletions

View File

@@ -22,6 +22,17 @@ export async function POST(request: Request) {
{ status: 400 }
);
}
if (error instanceof Error && error.message === "PASSWORD_NOT_STRONG") {
return NextResponse.json(
{
error: {
code: "PASSWORD_NOT_STRONG",
message: "Le mot de passe est trop faible",
},
},
{ status: 400 }
);
}
throw error;
}
} catch (error) {