-
Notifications
You must be signed in to change notification settings - Fork 30
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
option to work without a logged in user #15
Comments
Hmm. So the idea would be to be able to pass in a Is everything happening server-side here for you also? (i.e. we don't publish the @zol: what are your thoughts about accepting a PR for this? It adds complexity to the package but it seems a legit use case... |
To clarify, the way I have it working is if you pass in options.user then it works as you have it. Alternatively, if you pass in options.refreshTokenParams like in my example so you can manually manage the tokens. This way it should be backwards compatible. |
@tmeasday @philcruz - I can see how this would be useful. On the other hand, it's also kind of an edge case given that most do use Meteor accounts. Given that we haven't received requests for this, I would suggest forking the package for now and using it as a submodule in your project. If we receive more requests for the functionality, we'll extend the package. |
I have a very similar requirement. |
@ganySA I haven't published my fork yet but I will. I can't do it this week because I'm on travel. I'll do it the following week. |
@ganySA You can check out my code at https://github.com/philcruz/meteor-google-api/tree/develop |
Hi everybody, I'm using @philcruz package, and I found it very useful to access Google's API (contacts in my case), as the single source of Meteor accounts I have for my users isn't Google. So I vote for adding this extension if this is something you guys would consider. |
@tmeasday @zol - I develop a dashboard app, where multiple oAuth tokens to multiple services are saved to dashboards, and not to Meteor accounts (since there might be multiple users using the same dashboard). So I assume this is a somewhat generic requirement other people might have and I would really like to see this implemented. |
So I'm working with the Google APIs in a project and came across this package. It's nice that if the call fails it refreshes the token and retries the call for you. However, it's dependent on having a logged in user. You pass options.user and under the hood it fetches/updates from user and user.services.google.
In my project I'm handling OAuth manually so I don't have a logged in user. I would still like to have the refresh-retry functionality though. So I made some modifications that do that. Instead of passing in options.user you would pass options.refreshTokenParams
updateAccessToken = function(access_token) {
console.log("in updateAccessToken");
Tokens.upsert(
{account: Meteor.settings.account},
{ $set:
{
accessToken: access_token
//expiresIn: result.data.expires_in
}
}
);
}
Seem like a good approach?
The text was updated successfully, but these errors were encountered: