diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index c13527e2543fbda37bcddd324be4bfa2336432a1..f77babf2f6e6b3c5ce4100ad32f40fc4bb713bbd 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -31,7 +31,7 @@ class Users::RegistrationsController < Devise::RegistrationsController end def configure_sign_up_params - devise_parameter_sanitizer.permit(:sign_up, keys: [:language_id, :first_name, :last_name, :picture, :picture_infos, :picture_delete]) + devise_parameter_sanitizer.permit(:sign_up, keys: [:mobile_phone, :language_id, :first_name, :last_name, :picture, :picture_infos, :picture_delete]) end def configure_account_update_params diff --git a/app/views/admin/users/_lock.html.erb b/app/views/admin/users/_lock.html.erb index 02a9f27e919881c718bdecec6908ac6206dcbe36..7e0e3b166a43fccfa86a52880c486150a1bbf3b7 100644 --- a/app/views/admin/users/_lock.html.erb +++ b/app/views/admin/users/_lock.html.erb @@ -1,17 +1,21 @@ <% if @user.max_login_attempts? %> <div class="alert alert-danger"> - This user account is currently <i>locked</i> due to too many MFA attempts. - <%= link_to 'Unlock it now!', unlock_admin_user_path(@user), method: :patch, class: 'alert-link' if can?(:update, @user) %> + <div class="alert-message"> + <%= t('devise.two_factor_authentication.admin_locked_mfa_html') %> + <%= link_to t('devise.two_factor_authentication.admin_unlock'), unlock_admin_user_path(@user), method: :patch, class: 'alert-link' if can?(:update, @user) %> + </div> </div> <% end %> <% if @user.access_locked? %> <div class="alert alert-danger"> - This user account is currently <i>locked</i>. - <% if [:time, :both].include?(Rails.configuration.devise.unlock_strategy) %> - <% distance = distance_of_time_in_words(@user.locked_at + Rails.configuration.devise.unlock_in - Time.now.utc) %> - <%= "It will unlock automatically in <i>#{distance}</i>.".html_safe %> - <% end %> - <%= link_to 'Unlock it now!', unlock_admin_user_path(@user), method: :patch, class: 'alert-link' if can?(:update, @user) %> + <div class="alert-message"> + <%= t('devise.two_factor_authentication.admin_locked_html') %> + <% if [:time, :both].include?(Rails.configuration.devise.unlock_strategy) %> + <% distance = distance_of_time_in_words(@user.locked_at + Rails.configuration.devise.unlock_in - Time.now.utc) %> + <%= t('devise.two_factor_authentication.admin_unlock_in_html', distance: distance) %> + <% end %> + <%= link_to t('devise.two_factor_authentication.admin_unlock'), unlock_admin_user_path(@user), method: :patch, class: 'alert-link' if can?(:update, @user) %> + </div> </div> <% end %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 5aa32d8310649bf868e4a149b5eefc191a1979c8..0fed15704b22e803965e9ee1f8c719277e26c84e 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -39,6 +39,7 @@ allow_password_uncloaking: true, compare_with_field: :password, input_html: { autocomplete: "new-password" } %> + <%= f.input :mobile_phone %> <%= f.input :picture, as: :single_deletable_file, input_html: { accept: '.jpg,.jpeg,.png' }, diff --git a/config/locales/en.yml b/config/locales/en.yml index e3f26967a9e214cb38380c99c59b4b7b01e1f94b..14d7fd4cd72f2c417072631300a0b69eabd5f870 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -52,6 +52,10 @@ en: links: sign_out: "Sign out" two_factor_authentication: + admin_locked_html: This user account is currently <i>locked</i>. + admin_locked_mfa_html: This user account is currently <i>locked</i> due to too many MFA attempts. + admin_unlock_in_html: It will unlock automatically in <i>%{distance}</i>. + admin_unlock: Unlock it now! attempt_failed: "Invalid Code" code_has_been_sent: "Your authentication code has been sent." enter_code_direct_otp: "Enter the code that was sent to you" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 30df3c05dc17fb88b995ab5dfc92f471c45b6e9b..07e5a9d02f569634795ba3af150766d288db566f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -52,6 +52,10 @@ fr: links: sign_out: "Se déconnecter" two_factor_authentication: + admin_locked_html: Ce compte utilisateur est actuellement <i>verrouillé</i>. + admin_locked_mfa_html: Ce compte utilisateur est actuellement <i>verrouillé</i> à cause de tentatives de MFA excessives. + admin_unlock_in_html: Il se débloquera automatiquement dans <i>%{distance}</i>. + admin_unlock: Le débloquer ! attempt_failed: "Code invalide" code_has_been_sent: "Un code d'authentification vient de vous être envoyé." enter_code_direct_otp: "Entrez le code qui vous a été envoyé"