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

Don't auth if there is an existing bearer token #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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