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

Extract service packages from accounts packages #1024


Copy link

@timhaines timhaines commented May 7, 2013

Facebook, Github, Google, Meetup, Twitter, and Weibo packages have been refactored out from the related accounts-* packages.

Existing Account functionality (loginWithTwitter etc) works the same, with the exception that Meteor.loginWithTwitter, Meteor.loginWith_ExternalService_, Meteor.loginWithPassword, Meteor.loginWithToken have all been renamed to Accounts.loginWithX

The ExternalService packages have all had two methods added - requestCredential on the client and retrieveCredential on the server. This allows a meteor app to ask the user to provide twitter credentials, and the app can then do with the credentials what it pleases. Retrieving the credentials is no longer tied to the accounts system as it was. I've created a demo app that implements this for Twitter and Facebook.

There are 3 new oauth packages - oauth, oauth1, and oauth2. These are a refactor of the accounts-oauth* packages, and have been refactored to be used independently of accounts.

There is a new service-configuration package which is simply refactoring the configuration collection (and related ConfigError) out from accounts-base.

I have updated the documentation to reflect the renaming of the existing methods. I haven't added documentation for the new methods, as I figure it might be worth having a few people review them before officially documenting.

requestCredential is a client method that opens the login form for the related service, and prompts the user to authorize the app. It takes two arguments - options and credentialRequestCompleteCallback. The credentialRequestCompleteCallback is called after the third party authorization flow is complete. It is called with one argument, which may be an Error, or a credentialToken. If it's a credentialToken, it can be passed to a Meteor Method, which in turn calls the service's retrieveCredential method.

retrieveCredential is a server method that takes a credentialToken, and returns either the user's credentials for the service, or an Error if one occurred.

Copy link

@n1mmy n1mmy commented May 18, 2013

Merged! Great work, @timhaines. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants