Module: TwoFactorAuth::ApplicationHelper

Included in:
AuthenticationHook, RegistrationHook, TwoFactorAuthController
Defined in:
app/helpers/two_factor_auth/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#user_two_factor_auth_authenticated!(counter) ⇒ Object



7
8
9
10
# File 'app/helpers/two_factor_auth/application_helper.rb', line 7

def user_two_factor_auth_authenticated! counter
  Registration.authenticated(current_user, counter)
  user_session['two_factor_auth_authenticated'] = Time.now
end

#user_two_factor_auth_authenticated?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/helpers/two_factor_auth/application_helper.rb', line 12

def user_two_factor_auth_authenticated?
  user_session['two_factor_auth_authenticated'].present?
end

#user_two_factor_auth_registered?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/helpers/two_factor_auth/application_helper.rb', line 3

def user_two_factor_auth_registered?
  current_user.registrations.any?
end