mirror of
https://github.com/cnodejs/nodeclub.git
synced 2026-02-01 16:34:28 +00:00
current_user fix test
This commit is contained in:
parent
1618b2119c
commit
bb72c5ffde
@ -63,6 +63,9 @@ exports.gen_session = gen_session;
|
||||
exports.authUser = function (req, res, next) {
|
||||
var ep = new eventproxy();
|
||||
ep.fail(next);
|
||||
|
||||
// Ensure current_user always has defined.
|
||||
res.locals.current_user = null;
|
||||
|
||||
if (config.debug && req.cookies['mock_user']) {
|
||||
var mockUser = JSON.parse(req.cookies['mock_user']);
|
||||
@ -73,9 +76,6 @@ exports.authUser = function (req, res, next) {
|
||||
return next();
|
||||
}
|
||||
|
||||
// Ensure current_user always has defined.
|
||||
res.locals.current_user = null;
|
||||
|
||||
ep.all('get_user', function (user) {
|
||||
if (!user) {
|
||||
return next();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user