Skip to content
Snippets Groups Projects
Unverified Commit 22843e70 authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

require 2fa in registrations#edit (#2139)

parent 24bb861d
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
before_action :configure_sign_up_params, only: :create
before_action :configure_account_update_params, only: :update
before_action :confirm_two_factor_authenticated, except: [:new, :create, :cancel]
def edit
add_breadcrumb t('admin.dashboard'), :admin_root_path
......@@ -49,4 +50,10 @@ class Users::RegistrationsController < Devise::RegistrationsController
def sign_up_params
devise_parameter_sanitized = devise_parameter_sanitizer.sanitize(:sign_up).merge(registration_context: current_context)
end
def confirm_two_factor_authenticated
return if is_fully_authenticated?
flash[:alert] = t('devise.failure.unauthenticated')
redirect_to user_two_factor_authentication_url
end
end
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