Module: TwoFactorAuth::AuthenticationsHelper

Included in:
AuthenticationsController
Defined in:
app/helpers/two_factor_auth/authentications_helper.rb

Instance Method Summary collapse

Instance Method Details

#authentication_requestObject



3
4
5
6
7
8
9
10
11
# File 'app/helpers/two_factor_auth/authentications_helper.rb', line 3

def authentication_request
  @authentication_request ||= AuthenticationRequest.new(
    TwoFactorAuth.trusted_facet_list_url,
    Registration.key_handle_for_authentication(current_user),
    user_session['pending_authentication_request_challenge']
  )
  user_session['pending_authentication_request_challenge'] = @authentication_request.challenge
  @authentication_request
end

#clear_pending_challengeObject



13
14
15
# File 'app/helpers/two_factor_auth/authentications_helper.rb', line 13

def clear_pending_challenge
  user_session.delete 'pending_authentication_request_challenge'
end