Use Google api without logging out the current user


Im using accounts-password package and I don’t want to use any other services for login.

But in my app I have a requirement to use google api.

So how can I use Google api without logging out the current user, I need to request offline token too, Is there any way to do this?
I want to keep the login info in my db, it is just like login with google but I don’t want to logout the user logged in with password just like accounts-merge packages,but they’ll login the user which is not my requirement
Can somebody explain the flow how can I do this?

Any recommended packages?



If I understand your requirement correctly, you’ll need to talk directly to the API with Meteor’s HTTP calls.

You could also take a look at - a lightweight wrapper package for accessing generic REST endpoints (disclosure: I work for Centiq).


This is how I do on CodersTV:

To request offline token, it’s a configuration:
{requestOfflineToken: true}


What you can do is add accounts-google to your project and use one of (I’m sure there are a couple others similar)

To link your users’ google accounts to their local accounts.

And just like @gabrielhpugliese explained, use requestOfflineToken: true so that you don’t need them online while you are making API calls.