Skip to content

Commit

Permalink
Add linkedin support
Browse files Browse the repository at this point in the history
  • Loading branch information
yubozhao committed Jul 27, 2015
1 parent d0ff173 commit d79d880
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
18 changes: 18 additions & 0 deletions community-services/linkedin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if (Meteor.isClient) {
Meteor.linkWithLinkedIn = function (options, callback) {
if (!Meteor.userId()) {
throw new Meteor.Error(402, 'Please login to an existing account before link.');
}
if(!Package['jonperl:accounts-linkedin']) {
throw new Meteor.Error(403, 'Please include jonperl:accounts-linkedin package')
}

if (! callback && typeof options === "function") {
callback = options;
options = null;
}

var credentialRequestCompleteCallback = Accounts.oauth.linkCredentialRequestCompleteHandler(callback);
LinkedIn.requestCredential(options, credentialRequestCompleteCallback);
};
}
1 change: 0 additions & 1 deletion community-services/mailru.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

if (Meteor.isClient) {
Meteor.linkWithMailru = function (options, callback) {
if (!Meteor.userId()) {
Expand Down
1 change: 0 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ v. Next

v 1.2.0
=======
* service side callback
* unlink accounts
* linkedin support
1 change: 1 addition & 0 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Package.on_use(function (api) {
'community-services/ok.js',
'community-services/vk.js',
'community-services/mailru.js'
'community-services/linkedin.js'
], 'client');
});

Expand Down

0 comments on commit d79d880

Please sign in to comment.