1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib/error/password-previously-used.ts
Christopher Kolstad f65afff6c1
feat: Disallow repeating last 5 passwords. (#7552)
We'll store hashes for the last 5 passwords, fetch them all for the user
wanting to change their password, and make sure the password does not
verify against any of the 5 stored hashes.

Includes some password-related UI/UX improvements and refactors. Also
some fixes related to reset password rate limiting (instead of an
unhandled exception), and token expiration on error.

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2024-07-09 16:18:35 +02:00

12 lines
287 B
TypeScript

import { UnleashError } from './unleash-error';
export class PasswordPreviouslyUsedError extends UnleashError {
statusCode = 400;
constructor(
message: string = `You've previously used this password. Please use a new password.`,
) {
super(message);
}
}