Tronity: fix app token refresh
This commit is contained in:
parent
ec8357739c
commit
357a298e6d
1 changed files with 4 additions and 7 deletions
|
|
@ -152,15 +152,12 @@ func (v *Tronity) RefreshToken(_ *oauth2.Token) (*oauth2.Token, error) {
|
|||
GrantType: "app",
|
||||
}
|
||||
|
||||
req, err := request.New(http.MethodPost, v.oc.Endpoint.TokenURL, request.MarshalJSON(data), request.JSONEncoding)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req, _ := request.New(http.MethodPost, v.oc.Endpoint.TokenURL, request.MarshalJSON(data), request.JSONEncoding)
|
||||
|
||||
var token oauth2.Token
|
||||
err = request.NewHelper(v.log).DoJSON(req, &token)
|
||||
var token oauth.Token
|
||||
err := request.NewHelper(v.log).DoJSON(req, &token)
|
||||
|
||||
return &token, err
|
||||
return (*oauth2.Token)(&token), err
|
||||
}
|
||||
|
||||
// vehicles implements the vehicles api
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue