Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google idle Account #1

Closed
hipstersmoothie opened this issue Jun 1, 2015 · 4 comments
Closed

Google idle Account #1

hipstersmoothie opened this issue Jun 1, 2015 · 4 comments

Comments

@hipstersmoothie
Copy link
Owner

When a user is logged in for a period of time and leaves the browser, google cannot re-authenticate to get the likes. This may be because we don't get a refresh token, but I though meteor would handle that.

tssweeney added a commit that referenced this issue Jun 2, 2015
The issue found at Google idle Account #1 revealed that regardless if
liking or un-liking is successful or not, the client UI and collection
responds as if it is successful. This fix waits for confirmation from
the server before changing the client UI and collection status.
@tssweeney
Copy link
Collaborator

Ok, so it took a while to track this guy down. (I made a small fix on commit b3fe6b8 - it only changes the UI if the server request is successful) The timeout occurs after 1 - 1.25 hours of idle. The access token is persists, but I believe it is being invalidated on Google's end. The standard 401 that gets spit out is:

Exception while invoking method 'likeVideo' Error: failed [401] 
{
   "error": {
      "errors": [{ 
         "domain": "global",     
         "reason": "authError",    
         "message": "Invalid Credentials",     
         "locationType": "header",     
         "location": "Authorization"}],  
      "code": 401,   
      "message": "Invalid Credentials"
   }
}

after the Meteor.http.post('https://www.googleapis.com/youtube/v3/videos/rate?id='+id+'&rating=' + like + '&key{'+apiKey+'}&access_token='+Meteor.user().services.google.accessToken); call on line 76 of server/server.js. Oddly enough, all documentation stays that Meteors requestOfflineToken flag should take care of this. I can't find anyone else with a similar issue. Continuing to dig...

EDIT: According to Google the refreshToken should be used. Which we actually have (stored at Meteor.user().services.google.refreshToken).

@hipstersmoothie
Copy link
Owner Author

I'll change it to that and see if it is fixed

@hipstersmoothie
Copy link
Owner Author

well thats fucked meteor/meteor#522

@tssweeney
Copy link
Collaborator

Nice work - clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants