Class: Devise::TwoFactorAuthenticationController

Inherits:
DeviseController
  • Object
show all
Defined in:
app/controllers/devise/two_factor_authentication_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
# File 'app/controllers/devise/two_factor_authentication_controller.rb', line 5

def show
end

#updateObject



8
9
10
11
12
13
14
15
16
# File 'app/controllers/devise/two_factor_authentication_controller.rb', line 8

def update
  render :show and return if params[:code].nil?

  if resource.authenticate_otp(params[:code])
    after_two_factor_success_for(resource)
  else
    after_two_factor_fail_for(resource)
  end
end