mirror of
https://github.com/christianselig/apollo-backend
synced 2025-02-16 17:21:21 +00:00
print refresh token response
This commit is contained in:
parent
e46082949a
commit
fb6f7751ae
1 changed files with 2 additions and 5 deletions
|
@ -13,10 +13,6 @@ import (
|
||||||
"github.com/valyala/fastjson"
|
"github.com/valyala/fastjson"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
tokenURL = "https://www.reddit.com/api/v1/access_token"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
id string
|
id string
|
||||||
secret string
|
secret string
|
||||||
|
@ -155,7 +151,7 @@ func (rac *AuthenticatedClient) RefreshTokens() (*RefreshTokenResponse, error) {
|
||||||
req := NewRequest(
|
req := NewRequest(
|
||||||
WithTags([]string{"url:/api/v1/access_token"}),
|
WithTags([]string{"url:/api/v1/access_token"}),
|
||||||
WithMethod("POST"),
|
WithMethod("POST"),
|
||||||
WithURL(tokenURL),
|
WithURL("https://www.reddit.com/api/v1/access_token"),
|
||||||
WithBody("grant_type", "refresh_token"),
|
WithBody("grant_type", "refresh_token"),
|
||||||
WithBody("refresh_token", rac.refreshToken),
|
WithBody("refresh_token", rac.refreshToken),
|
||||||
WithBasicAuth(rac.id, rac.secret),
|
WithBasicAuth(rac.id, rac.secret),
|
||||||
|
@ -165,6 +161,7 @@ func (rac *AuthenticatedClient) RefreshTokens() (*RefreshTokenResponse, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
fmt.Println(rtr)
|
||||||
return rtr.(*RefreshTokenResponse), nil
|
return rtr.(*RefreshTokenResponse), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue