Class: Devise::TwilioTwoFactorController
- Inherits:
-
DeviseController
- Object
- DeviseController
- Devise::TwilioTwoFactorController
- Defined in:
- app/controllers/devise/twilio_two_factor_controller.rb
Instance Method Summary collapse
Instance Method Details
#authenticate_scope! ⇒ Object
7 8 9 |
# File 'app/controllers/devise/twilio_two_factor_controller.rb', line 7 def authenticate_scope! self.resource = send("current_#{resource_name}") end |
#resend_code ⇒ Object
24 25 26 27 |
# File 'app/controllers/devise/twilio_two_factor_controller.rb', line 24 def resend_code resource.send_otp_code redirect_to send("#{resource_name}_twilio_two_factor_path"), notice: I18n.t('devise.twilio_two_factor.code_has_been_sent') end |
#show ⇒ Object
11 12 |
# File 'app/controllers/devise/twilio_two_factor_controller.rb', line 11 def show end |
#update ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/devise/twilio_two_factor_controller.rb', line 14 def update render :show and return if params[:code].nil? if resource.verify_otp_code(params[:code]) after_two_factor_success_for(resource) else after_two_factor_fail_for(resource) end end |