Skip to content

Instantly share code, notes, and snippets.

@cwaring
Last active December 19, 2015 08:49
Show Gist options
  • Save cwaring/5928926 to your computer and use it in GitHub Desktop.
Save cwaring/5928926 to your computer and use it in GitHub Desktop.
Meteor basic auth
Meteor.startup(function() {
var connect = Meteor.require('connect');
WebApp.connectHandlers.use(connect.basicAuth('un', 'pw'));
// move auth to the top of the stack
var basicAuth = WebApp.connectHandlers.stack.pop();
WebApp.connectHandlers.stack.unshift(basicAuth);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment