feat(ST-l9kkxh2m): /reset-password pagina + resetPasswordAction + hashPassword

- lib/auth.ts: hashPassword(password) geëxporteerd (bcrypt, rounds=12)
- actions/auth.ts: resetPasswordAction met Zod-validatie (min 8, superRefine gelijkheid),
  prisma.user.update (password_hash + must_reset_password=false), redirect /dashboard
- app/(auth)/reset-password/page.tsx: server guard (userId check + must_reset_password check)
- app/(auth)/reset-password/reset-form.tsx: client form (nieuw wachtwoord + bevestiging)
- __tests__/actions/auth.test.ts: 3 tests voor resetPasswordAction
This commit is contained in:
Scrum4Me Agent 2026-05-05 14:30:59 +02:00
parent 71281038ff
commit a19ae89e37
5 changed files with 206 additions and 3 deletions

View file

@ -66,3 +66,7 @@ export async function verifyUser(username: string, password: string) {
return user
}
export async function hashPassword(password: string): Promise<string> {
return bcrypt.hash(password, 12)
}