fix(auth): new passwords need at least 8 characters (FLAW-09)
auth.ValidatePassword checks every way a password is set: setup, registration, profile, admin create and reset, reset by mail. Same rule in the browser before sending (lib/password.ts), with our own German message instead of the browser popup. Existing shorter passwords still log in. Profile and admin reset no longer trim the password, which made passwords with surrounding spaces unusable for login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f8989d0c44
commit
b5f926bcf7
13 files changed
+142
-26
No files matched your search
@@ -0,0 +1,8 @@
|
||||
// Same rule as the server (auth.ValidatePassword): at least 8 characters, not only spaces.
|
||||
// Only for setting a password; logging in with an older, shorter one keeps working.
|
||||
export const MIN_PASSWORD_LENGTH = 8;
|
||||
|
||||
export const passwordProblem = (password: string): string | null =>
|
||||
!password.trim() || Array.from(password).length < MIN_PASSWORD_LENGTH
|
||||
? `Das Passwort muss mindestens ${MIN_PASSWORD_LENGTH} Zeichen lang sein`
|
||||
: null;
|
||||
Reference in new issue
Block a user