Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Don't auth if there is an existing bearer token
Browse files Browse the repository at this point in the history
  • Loading branch information
markpeek committed Mar 16, 2019
1 parent 23da1d2 commit b442d4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/vra_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func (c *APIClient) DoRequest(req *APIRequest, login bool) (*APIResponse, error)
return nil, err
}
if !login {
c.Authenticate()
if c.BearerToken == "" {
c.Authenticate()
}
r.Header.Add(AuthorizationHeader, c.BearerToken)
}
r.Header.Add(ConnectionHeader, CloseConnection)
Expand Down

0 comments on commit b442d4b

Please sign in to comment.