Skip to content

Commit

Permalink
Always cleanup the test callback URL [CLI-116] (#218)
Browse files Browse the repository at this point in the history
* Alwyays cleanup the test callback URL

* Add TODO
  • Loading branch information
Widcket authored Apr 2, 2021
1 parent fbce21f commit d2f89fa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/cli/utils_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ func runLoginFlow(cli *cli, t tenant, c *management.Client, connName, audience,

// if we added the local callback URL to the client then we need to
// remove it when we're done
if callbackAdded {
if err := removeLocalCallbackURLFromClient(cli.api.Client, c); err != nil {
return err
defer func() {
if callbackAdded {
if err := removeLocalCallbackURLFromClient(cli.api.Client, c); err != nil { // TODO: Make it a warning
cli.renderer.Errorf("Unable to remove callback URL '%s' from client: %s", cliLoginTestingCallbackURL, err)
}
}
}
}()

return nil
})
Expand Down

0 comments on commit d2f89fa

Please sign in to comment.