Class: TwoFactorAuth::RegistrationsController
- Inherits:
-
TwoFactorAuthController
- Object
- ApplicationController
- TwoFactorAuthController
- TwoFactorAuth::RegistrationsController
- Includes:
- RegistrationsHelper
- Defined in:
- app/controllers/two_factor_auth/registrations_controller.rb
Instance Method Summary collapse
Methods included from RegistrationsHelper
#clear_pending_challenge, #registration_request
Methods included from ApplicationHelper
#user_two_factor_auth_authenticated!, #user_two_factor_auth_authenticated?, #user_two_factor_auth_registered?
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/two_factor_auth/registrations_controller.rb', line 11 def create verifier = RegistrationVerifier.new({ login: current_user, request: registration_request, client_data: ClientData.new(encoded: params[:clientData], correct_typ: 'navigator.id.finishEnrollment'), response: RegistrationResponse.new(encoded: params[:registrationData]), }) clear_pending_challenge if verifier.save user_two_factor_auth_authenticated! 0 # don't need to auth again after registration redirect_to after_two_factor_auth_registrations_path_for(current_user) else flash[:alert] = "Unable to register" render :new, status: 406 end end |
#new ⇒ Object
8 9 |
# File 'app/controllers/two_factor_auth/registrations_controller.rb', line 8 def new end |