make login a private method
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4ff4c62daf
commit
8a61bba688
@ -88,11 +88,9 @@ func (c *client) processResponse(res *http.Response, out interface{}) error {
|
||||
// and exchanges it for an access token. Returns a timer that
|
||||
// expires when the login session is over.
|
||||
// TODO - Return a proper error when login fails with HTTP 400 - Bad Request
|
||||
func (c *client) Login() error {
|
||||
login := loginServerURL
|
||||
|
||||
func (c *client) login() error {
|
||||
vars := url.Values{"grant_type": {"refresh_token"}, "refresh_token": {c.Credentials.RefreshToken}}
|
||||
res, err := c.httpClient.PostForm(login+"token", vars)
|
||||
res, err := c.httpClient.PostForm(loginServerURL+"token", vars)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@ -126,7 +124,7 @@ func newClient(refreshToken string) (*client, error) {
|
||||
transport: transport,
|
||||
}
|
||||
|
||||
err := c.Login()
|
||||
err := c.login()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user