def handle_two_step_failure(ex)
      if ENV[TWO_FACTOR_ENV_VARIABLE].to_s.length > 0
        # Password provided, however we already used it
        UI.error("")
        UI.error("Application specific password you provided using")
        UI.error("environment variable #{TWO_FACTOR_ENV_VARIABLE}")
        UI.error("is invalid, please make sure it's correct")
        UI.error("")
        UI.user_error!("Invalid application specific password provided")
      end

      a = CredentialsManager::AccountManager.new(user: @user,
                                               prefix: TWO_STEP_HOST_PREFIX,
                                                 note: "application-specific")
      if a.password(ask_if_missing: false).to_s.length > 0
        # user already entered one.. delete the old one
        UI.error("Application specific password seems wrong")
        UI.error("Please make sure to follow the instructions")
        a.remove_from_keychain
      end
      UI.error("")
      UI.error("Your account has 2 step verification enabled")
      UI.error("Please go to https://appleid.apple.com/account/manage")
      UI.error("and generate an application specific password for")
      UI.error("the iTunes Transporter, which is used to upload builds")
      UI.error("")
      UI.error("To set the application specific password on a CI machine using")
      UI.error("an environment variable, you can set the")
      UI.error("#{TWO_FACTOR_ENV_VARIABLE} variable")
      @password = a.password(ask_if_missing: true) # to ask the user for the missing value

      return true
    end
def handle_two_step_failure(ex)
      if ENV[TWO_FACTOR_ENV_VARIABLE].to_s.length > 0
        # Password provided, however we already used it
        UI.error("")
        UI.error("Application specific password you provided using")
        UI.error("environment variable #{TWO_FACTOR_ENV_VARIABLE}")
        UI.error("is invalid, please make sure it's correct")
        UI.error("")
        UI.user_error!("Invalid application specific password provided")
      end

      a = CredentialsManager::AccountManager.new(user: @user,
                                               prefix: TWO_STEP_HOST_PREFIX,
                                                 note: "application-specific")
      if a.password(ask_if_missing: false).to_s.length > 0
        # user already entered one.. delete the old one
        UI.error("Application specific password seems wrong")
        UI.error("Please make sure to follow the instructions")
        a.remove_from_keychain
      end
      UI.error("")
      UI.error("Your account has 2 step verification enabled")
      UI.error("Please go to https://appleid.apple.com/account/manage")
      UI.error("and generate an application specific password for")
      UI.error("the iTunes Transporter, which is used to upload builds")
      UI.error("")
      UI.error("To set the application specific password on a CI machine using")
      UI.error("an environment variable, you can set the")
      UI.error("#{TWO_FACTOR_ENV_VARIABLE} variable")
      @password = a.password(ask_if_missing: true) # to ask the user for the missing value

      return true
    end
def handle_two_step_failure ( ex ) if ENV [ TWO_FACTOR_ENV_VARIABLE ] . to_s . length > 0 # Password provided, however we already used it UI . error ( "" ) UI . error ( "Application specific password you provided using" ) UI . error ( "environment variable #{TWO_FACTOR_ENV_VARIABLE}" ) UI . error ( "is invalid, please make sure it's correct" ) UI . error ( "" ) UI . user_error! ( "Invalid application specific password provided" ) end a = CredentialsManager :: AccountManager . new ( user : @user , prefix : TWO_STEP_HOST_PREFIX , note : "application-specific" ) if a . password ( ask_if_missing : false ) . to_s . length > 0 # user already entered one.. delete the old one UI . error ( "Application specific password seems wrong" ) UI . error ( "Please make sure to follow the instructions" ) a . remove_from_keychain end UI . error ( "" ) UI . error ( "Your account has 2 step verification enabled" ) UI . error ( "Please go to https://appleid.apple.com/account/manage" ) UI . error ( "and generate an application specific password for" ) UI . error ( "the iTunes Transporter, which is used to upload builds" ) UI . error ( "" ) UI . error ( "To set the application specific password on a CI machine using" ) UI . error ( "an environment variable, you can set the" ) UI . error ( "#{TWO_FACTOR_ENV_VARIABLE} variable" ) @password = a . password ( ask_if_missing : true ) # to ask the user for the missing value return true end
Tells the user how to get an application specific password
Tells the user how to get an application specific password