Skip to content

Commit

Permalink
Set the max limit on password size with some notes about BCrypt usage…
Browse files Browse the repository at this point in the history
… for clarity. Fixes #691 (#692)
  • Loading branch information
jwoertink authored Oct 28, 2021
1 parent 947dbc3 commit 10004ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module PasswordValidations
private def run_password_validations
validate_required password, password_confirmation
validate_confirmation_of password, with: password_confirmation
validate_size_of password, min: 6
# 72 is a limitation of BCrypt
validate_size_of password, min: 6, max: 72
end
end
1 change: 1 addition & 0 deletions src/web_app_skeleton/config/authentic.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Authentic.configure do |settings|
settings.secret_key = Lucky::Server.settings.secret_key_base

unless LuckyEnv.production?
# This value can be between 4 and 31
fastest_encryption_possible = 4
settings.encryption_cost = fastest_encryption_possible
end
Expand Down

0 comments on commit 10004ae

Please sign in to comment.