Skip to content

Commit 2f0aefb

Browse files
committed
Re-add ability to set access token independently
1 parent f71cf28 commit 2f0aefb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ func (c *Client) Ping() bool {
8282
return true
8383
}
8484

85-
// TokenAuth sets authorization headers for subsequent requests.
86-
func (c *Client) TokenAuth(token string) *Client {
87-
c.Transport.header.Set("Authorization", "Bearer "+token)
88-
c.Transport.header.Set("apikey", token)
85+
// SetApiKey sets api key header for subsequent requests.
86+
func (c *Client) SetApiKey(apiKey string) *Client {
87+
c.Transport.header.Set("apikey", apiKey)
88+
return c
89+
}
8990

91+
// SetAuthToken sets authorization header for subsequent requests.
92+
func (c *Client) SetAuthToken(authToken string) *Client {
93+
c.Transport.header.Set("Authorization", "Bearer "+authToken)
9094
return c
9195
}
9296

0 commit comments

Comments
 (0)