Method: NubankSdk::Auth#request_email_code

Defined in:
lib/nubank_sdk/auth.rb

#request_email_code(password) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/nubank_sdk/auth.rb', line 32

def request_email_code(password)
  response = default_connection.post(@gen_certificate_path, payload(password))

  response_parsed = parse_authenticate_headers(response.headers['WWW-Authenticate'])
  @encrypted_code = response_parsed[:device_authorization_encrypted_code]

  response_parsed[:sent_to]
end