Class: TwoFactorAuth::RegistrationsController
Instance Method Summary
collapse
#clear_pending_registration_challenge, #registration_request, #two_factor_auth_registration, #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_registration_challenge
if verifier.save
user_two_factor_auth_authenticated! 0 redirect_to after_two_factor_auth_registration_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
|