checks.js
function(request, response, next){
		if (!utils.Misc.isNullOrUndefined(request.user) || request.originalUrl == '/error' || request.originalUrl.indexOf('/error?') == 0) {
			next();
		}
		else {
			var success = encodeURIComponent(request.protocol + '://' + request.get('host') + request.originalUrl);
			response.redirect('/login?success=' + success + '&no_query=true'); //we don't want it to add any query string
		}
	}
function(request, response, next){
		if (!utils.Misc.isNullOrUndefined(request.user) || request.originalUrl == '/error' || request.originalUrl.indexOf('/error?') == 0) {
			next();
		}
		else {
			var success = encodeURIComponent(request.protocol + '://' + request.get('host') + request.originalUrl);
			response.redirect('/login?success=' + success + '&no_query=true'); //we don't want it to add any query string
		}
	}
function ( request , response , next ) { if ( ! utils . Misc . isNullOrUndefined ( request . user ) || request . originalUrl == '/error' || request . originalUrl . indexOf ( '/error?' ) == 0 ) { next ( ) ; } else { var success = encodeURIComponent ( request . protocol + '://' + request . get ( 'host' ) + request . originalUrl ) ; response . redirect ( '/login?success=' + success + '&no_query=true' ) ; //we don't want it to add any query string } }
checks for logged-in UI user
checks for logged - in UI user