mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
started work on #2082
This commit is contained in:
@@ -16,6 +16,7 @@ var app,
|
||||
topics = require('./../topics'),
|
||||
messaging = require('../messaging'),
|
||||
ensureLoggedIn = require('connect-ensure-login'),
|
||||
csrf = require('csurf'),
|
||||
|
||||
controllers = {
|
||||
api: require('./../controllers/api')
|
||||
@@ -33,6 +34,8 @@ middleware.authenticate = function(req, res, next) {
|
||||
}
|
||||
};
|
||||
|
||||
middleware.requireCSRF = csrf();
|
||||
|
||||
middleware.ensureLoggedIn = ensureLoggedIn.ensureLoggedIn();
|
||||
|
||||
middleware.updateLastOnlineTime = function(req, res, next) {
|
||||
@@ -251,7 +254,7 @@ middleware.renderHeader = function(req, res, callback) {
|
||||
'cache-buster': meta.config['cache-buster'] ? 'v=' + meta.config['cache-buster'] : '',
|
||||
'brand:logo': meta.config['brand:logo'] || '',
|
||||
'brand:logo:display': meta.config['brand:logo']?'':'hide',
|
||||
csrf: res.locals.csrf_token,
|
||||
csrf: req.csrfToken ? req.csrfToken() : undefined,
|
||||
navigation: custom_header.navigation,
|
||||
allowRegistration: meta.config.allowRegistration === undefined || parseInt(meta.config.allowRegistration, 10) === 1,
|
||||
searchEnabled: plugins.hasListeners('filter:search.query')
|
||||
|
||||
Reference in New Issue
Block a user