Use old refresh token if new one is missing

This commit is contained in:
Andre Medeiros 2021-07-15 18:53:22 -04:00
parent fb6f7751ae
commit 893e5bd5a3

View file

@ -161,8 +161,13 @@ 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 ret := rtr.(*RefreshTokenResponse)
if ret.RefreshToken == "" {
ret.RefreshToken = rac.refreshToken
}
return ret, nil
} }
func (rac *AuthenticatedClient) MessageInbox(opts ...RequestOption) (*ListingResponse, error) { func (rac *AuthenticatedClient) MessageInbox(opts ...RequestOption) (*ListingResponse, error) {