Skip to content
Snippets Groups Projects
Commit 818ccf98 authored by pabois's avatar pabois
Browse files

errors registration

parent 61a37525
No related branches found
No related tags found
No related merge requests found
.password
position: relative
.sfpwh-password-toggle
top: calc(50% - 6px)
top: 36px
.sfpwh-controls ~ .invalid-feedback
margin-top: 0
legend ~ *
clear: left
......@@ -78,7 +78,7 @@ module User::WithAuthentication
def password_complexity
# Regexp extracted from https://stackoverflow.com/questions/19605150/regex-for-password-must-contain-at-least-eight-characters-at-least-one-number-a
return if password.blank? || password =~ /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#{Rails.application.config.allowed_special_chars}]).{#{Devise.password_length.first},#{Devise.password_length.last}}$/
errors.add :password, I18n.t('activerecord.errors.models.user.password.password_strength')
errors.add :password, :password_strength
end
end
end
......@@ -26,6 +26,12 @@ en:
mobile_phone: Mobile phone
picture: Profile picture
role: Role
errors:
models:
user:
attributes:
password:
password_strength: doesn't match the security policy
models:
language:
one: Language
......
......@@ -26,6 +26,12 @@ fr:
mobile_phone: Téléphone portable
picture: Photo de profil
role: Rôle
errors:
models:
user:
attributes:
password:
password_strength: ne répond pas aux critères de sécurité
models:
language:
one: Langue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment