Skip to content

Commit

Permalink
Merge pull request #1056 from synfinatic/fix-crash
Browse files Browse the repository at this point in the history
fix crash due to go variable context change
  • Loading branch information
synfinatic authored Sep 21, 2024
2 parents 60c56c4 + 8687d9e commit f055a85
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run Wizard",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/aws-sso/",
"args": ["setup", "wizard", "--config=foo.yaml", "--hostname=synfinatic", "--region=us-east-2", "--profile-format=Friendly"]
},
{
"name": "List Profiles",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/aws-sso/",
"args": ["list", "--config=${workspaceFolder}/config.yaml"]
},

{
"name": "Run ECS Server",
"type": "go",
Expand Down
4 changes: 2 additions & 2 deletions internal/sso/awssso.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ func (as *AWSSSO) ListAccounts(input *sso.ListAccountsInput) (*sso.ListAccountsO
as.rolesLock.Lock()
log.Error("AccessToken Unauthorized Error; refreshing", "error", err.Error())

if err = as.reauthenticate(); err != nil {
if err2 := as.reauthenticate(); err2 != nil {
// fail hard now
return output, err
return output, err2
}
input.AccessToken = aws.String(as.Token.AccessToken)
as.rolesLock.Unlock()
Expand Down

0 comments on commit f055a85

Please sign in to comment.