filters.js
368 Bytes
module.exports=function(Filter){
Filter.define("/!(login)", ["get","post"], "common_gray", function (gray, req, res, next){
if(gray.code==200){
console.log("gray filter code 200");
next();
}else{
if(req.xhr){
res.json(gray);
}else{
console.log("gray filter code 201");
res.redirect('/login?t=' + new Date().getTime());
}
}
});
};