Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var basicAuth = require('basic-auth'),
- auth = function (req, res, next) {
- var user = basicAuth(req);
- if (user && user.name === "user" && user.pass === "password") return next();
- res.set('WWW-Authenticate', 'Basic realm=Authorization Required');
- return res.send(401);
- };
- module.exports.http = {
- customMiddleware: function (app) {
- app.use('/', auth);
- },
- if (sails.config.environment === 'staging') {}
- if (sails.config.environment === 'staging') {
- ^
- ReferenceError: sails is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement