Hi Guys
Im stuck in a node.js script where I have a function that doesnt work, I Feel I have tried everything.
// load up the user model
var User = require('../app/models/user');
// auth.js
module.exports = {
// route middleware to make sure
isLoggedIn: function (req, res, next) {
// if user is authenticated in the session, carry on
if (req.isAuthenticated())
return next();
//next();
else {
// if they aren't redirect them to the home page
res.redirect('/');
}
},
isInCompany: function(req, res, next) {
module.exports.isLoggedIn,
function (req, res, next) {
return next();
}
},
As you can see my problem is that this doesnt work :
isInCompany: function(req, res, next) {
module.exports.isLoggedIn,
function (req, res, next) {
return next();
}
I hope someone can give me a pointer on whats wrong/ or a solution
Aucun commentaire:
Enregistrer un commentaire