Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfairhead authored Nov 4, 2020
1 parent 5e56759 commit c912dc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/aptible
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end
begin
Aptible::CLI::Agent.start
rescue HyperResource::ClientError => e
m = if e.body['error'] == 'invalid_token'
m = if %w(invalid_token expired_token).include? e.body['error']
'API authentication error: please run aptible login'
else
"An error occurred: #{e.body['message']}"
Expand Down
7 changes: 2 additions & 5 deletions lib/aptible/cli/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,15 @@ def nag_toolbelt

def warn_sso_enforcement
# If the user is also a member of
begin
token = fetch_token
rescue StandardError
return
end
token = fetch_token
reauth = Aptible::Auth::ReauthenticateOrganization.all(token: token)
return if reauth.empty?

CLI.logger.warn(['WARNING: You will need to use the appropriate',
'login method (SSO or Aptible credentials) to access',
'these organizations:',
reauth.map(&:name)].join(' '))
rescue StandardError
end

def version_string
Expand Down
2 changes: 1 addition & 1 deletion lib/aptible/cli/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Aptible
module CLI
VERSION = '0.16.8'.freeze
VERSION = '0.16.9'.freeze
end
end

0 comments on commit c912dc2

Please sign in to comment.