kylejginavan/youtube_it — pull request #73 by masterkain (2012-04-10 17:20:26+00:00)
Title: OAuth2Client refresh token is blank when refreshing

Hello,
I'm using something like this:

```ruby
::YouTubeIt::OAuth2Client.new({
client_token_expires_at: @youtube_credentials.expires_at,
client_access_token: @youtube_credentials.token,
client_refresh_token: @youtube_credentials.refresh_token,
client_id: Settings.services.youtube.client_key,
client_secret: Settings.services.youtube.client_secret,
dev_key: Settings.services.youtube.developer_key,
})
```

I save this data in order to properly refresh the token when it does expires (it does so by raising a OAuth2::Error).

It should be noted that I'm using `client_token_expires_at` because I think that the proposed `expires_at` in readme is wrong, this pull request should fix this.

When I refresh the token through `client.refresh_access_token!` what I have back is an instance of `OAuth2::AccessToken` which does indeed contain a new `token` but the `refresh_token` is nil.

I need the refresh_token stored somewhere in order to refresh the old one at the next authentication error.
I'm still not sure if this AccessToken should bear the refresh_token but I can't see other ways to perform a refresh afterwards.

Thanks.