Open cookie-ag opened 8 years ago
Here is my code
var webshot = require('webshot'); var fs = require('fs'); var domain = require('../config').domain; exports.error404 = function(req, res, next) { var err = new Error('Not found'); err.status = 404; if (!req.user) { webshot(domain + req.path,RID + '_Error.png',function(err) { if(err){ console.log(err); } }); req.flash('ErrorMSG', '' + req.path + ' is not allowed, redirecting to Login.'); console.log("Logging HTTP Error : " + err.status + " - " + err.message + " - " + req.path + " - From " + req.connection.remoteAddress + " - Using " + req.headers['user-agent'] + " - By Unauthenticated" + " - Request ID : " + RID); } if (req.user) { req.flash('ErrorMSGLoggedin', '' + req.path + ' is not allowed, redirecting to tasks.'); console.log("Logging HTTP Error : " + err.status + " - " + err.message + " - " + req.path + " - From " + req.connection.remoteAddress + " - Using " + req.headers['user-agent'] + " - By " + req.session.email + " - Request ID : " + RID); } res.redirect('/login'); };
Whenever i GET an undefined path the same goes into loop filling my console screen with multiple queries. It was all ok before. Any ideas?
Here is my code
Whenever i GET an undefined path the same goes into loop filling my console screen with multiple queries. It was all ok before. Any ideas?