-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhuddle.js
26 lines (23 loc) · 852 Bytes
/
huddle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Accounts.oauth.registerService('huddle');
if (Meteor.isClient) {
Meteor.loginWithHuddle = function(options, callback) {
// support a callback without options
if (!callback && typeof options === "function") {
callback = options;
options = {};
}
if (!options) options = {};
var credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback);
Huddle.requestCredential(options, credentialRequestCompleteCallback);
};
} else {
Accounts.addAutopublishFields({
forLoggedInUser: _.map(Huddle.whitelistedFields, function (subfield) {
return 'services.huddle.' + subfield;
}),
// Do not publish user emails
forOtherUsers: _.map(_.without(Huddle.whitelistedFields, 'login', 'email'), function (subfield) {
return 'services.huddle.' + subfield;
})
});
}