Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
janpio committed Apr 18, 2019
1 parent 4b99afb commit 00da023
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions spaceship/lib/spaceship/two_step_or_factor_client.rb
Expand Up @@ -123,13 +123,14 @@ def handle_two_factor(response, depth = 0)
code_length = security_code["length"]

puts("")
2fa_sms_default_phone_number = ENV["SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER"]
if 2fa_sms_default_phone_number
raise Tunes::Error.new, "Environment variable SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER is set, but empty." if 2fa_sms_default_phone_number.empty?
env_2fa_sms_default_phone_number = ENV["SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER"]

if env_2fa_sms_default_phone_number
raise Tunes::Error.new, "Environment variable SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER is set, but empty." if env_2fa_sms_default_phone_number.empty?

puts("Environment variable `SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER` is set, automatically requesting 2FA token via SMS to that number")
puts("SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER = #{2fa_sms_default_phone_number}")
phone_number = 2fa_sms_default_phone_number
puts("SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER = #{env_2fa_sms_default_phone_number}")
phone_number = env_2fa_sms_default_phone_number
phone_id = phone_id_from_number(response.body["trustedPhoneNumbers"], phone_number)
code_type = 'phone'
body = request_two_factor_code_from_phone(phone_id, phone_number, code_length)
Expand Down

0 comments on commit 00da023

Please sign in to comment.