oauth2-extensions icon indicating copy to clipboard operation
oauth2-extensions copied to clipboard

OAuth2 loses refresh tokens when used with the Google adapter

Open AMKohn opened this issue 11 years ago • 0 comments

Hi,

First off, thank you for the library! It definitely makes working with OAuth easier.

I've been using it with the Google adapter and it seems to be losing refresh tokens.

I tracked the problem down and it looks like in oauth2.js on line 426 it sets newData.refreshToken to the refresh token value returned by refreshAccessToken(). The problem is that Google only sends a refresh token during the first OAuth exchange.

I modified my local copy of oauth2.js to set the refresh token like this instead: newData.refreshToken = re || data.refreshToken; and submitted a pull request

AMKohn avatar Dec 13 '13 17:12 AMKohn