mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-01 04:46:26 +02:00
* DRY req props that depend on auth (fix #6727) authentication leads to req.loggedIn and req.uid being set. However, a later authentication event might outdate them. Here, I create one function for setting those properties, and make sure it also is called on the `action:middleware.authenticate` hook, which would be such an authentication event. If there are other places, those should be added as well. * fix lint errors * fix lint error * change exports
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
3e1b007f9f
commit
c7f3b76b4e
@@ -8,7 +8,7 @@ var groups = require('../groups');
|
||||
var user = require('../user');
|
||||
var helpers = require('./helpers');
|
||||
|
||||
var groupsController = {};
|
||||
var groupsController = module.exports;
|
||||
|
||||
groupsController.list = function (req, res, next) {
|
||||
var sort = req.query.sort || 'alpha';
|
||||
@@ -177,5 +177,3 @@ groupsController.uploadCover = function (req, res, next) {
|
||||
res.json([{ url: image.url }]);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = groupsController;
|
||||
|
||||
Reference in New Issue
Block a user