mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-01 00:38:34 -05:00
feat(api): enforce password validation on reset and update flows
Add bcrypt_password validation to password reset and update endpoints: - Add validation tag to PasswordReset.NewPassword struct field - Add validation tag to UserPassword.NewPassword struct field - Add c.Validate() calls in both handlers - Fix off-by-one error in bcrypt_password validator (use <= 72 not < 72) Password requirements: min 8 chars, max 72 bytes (bcrypt limit)
This commit is contained in:
@@ -27,7 +27,7 @@ type PasswordReset struct {
|
||||
// The previously issued reset token.
|
||||
Token string `json:"token"`
|
||||
// The new password for this user.
|
||||
NewPassword string `json:"new_password"`
|
||||
NewPassword string `json:"new_password" valid:"bcrypt_password" minLength:"8" maxLength:"72"`
|
||||
}
|
||||
|
||||
// ResetPassword resets a users password. It returns the ID of the user whose
|
||||
|
||||
Reference in New Issue
Block a user