Class: Booth::Test::Support::OtpCodeFromSession

Inherits:
Object
  • Object
show all
Includes:
MethodObject
Defined in:
lib/booth/test/support/otp_code_from_session.rb

Instance Method Summary collapse

Methods included from MethodObject

included

Instance Method Details

#callObject



10
11
12
13
14
15
16
# File 'lib/booth/test/support/otp_code_from_session.rb', line 10

def call
  secret_key = load_secret_key
  raise 'No OTP secret key found in session' if secret_key.blank?

  dummy = ::Booth::Models::Credential.new otp_secret_key: secret_key
  dummy.otp_code
end