Skip to content

Commit 796eb66

Browse files
authored
Clarify ActiveModel::SecurePassword maximum password length
Since 74264f4 improved the secure_password length validation to match bcrypt limit, this validation can be described more accurately in the ActiveModel basics guide.
1 parent ca5132b commit 796eb66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

guides/source/active_model_basics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ The following validations are added automatically:
527527

528528
1. Password should be present.
529529
2. Password should be equal to its confirmation (provided `XXX_confirmation` is passed along).
530-
3. The maximum length of a password is 72 (required by `bcrypt` on which ActiveModel::SecurePassword depends)
530+
3. The maximum length of a password is 72 bytes (required as `bcrypt`, on which
531+
ActiveModel::SecurePassword depends, truncates the string to this size before encrypting it).
531532

532533
#### Examples
533534

0 commit comments

Comments
 (0)