Skip to content

Instantly share code, notes, and snippets.

@deholic
Created October 23, 2012 02:53
Show Gist options
  • Save deholic/3936395 to your computer and use it in GitHub Desktop.
Save deholic/3936395 to your computer and use it in GitHub Desktop.
Prepare twitter oauth in Meteor 0.5.0
Meteor.startup(function() {
// check twitter authorize
var config = Accounts.loginServiceConfiguration.findOne({service: "twitter"});
if(!config) {
Accounts.loginServiceConfiguration.insert({
service: "twitter",
consumerKey: "YOUR_APP_CONSUMER_KEY",
secret: "YOUR_APP_CONSUMER_SECRET"
});
};
});
Template.configureLoginServiceDialogForTwitter.siteUrl = function () {
// Twitter doesn't recognize localhost as a domain name
return Meteor.absoluteUrl({replaceLocalhost: true});
};
Template.configureLoginServiceDialogForTwitter.fields = function () {
return [
{property: 'consumerKey', label: 'Consumer key'},
{property: 'secret', label: 'Consumer secret'}
];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment