mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
closes #5847
This commit is contained in:
@@ -166,7 +166,13 @@ module.exports = function (middleware) {
|
||||
return next();
|
||||
}
|
||||
|
||||
req.session.returnTo = req.path.replace(/^\/api/, '');
|
||||
var returnTo = req.path;
|
||||
if (nconf.get('relative_path')) {
|
||||
returnTo = req.path.replace(new RegExp('^' + nconf.get('relative_path')), '');
|
||||
}
|
||||
returnTo = returnTo.replace(/^\/api/, '');
|
||||
|
||||
req.session.returnTo = nconf.get('relative_path') + returnTo;
|
||||
req.session.forceLogin = 1;
|
||||
if (res.locals.isAPI) {
|
||||
res.status(401).json({});
|
||||
|
||||
Reference in New Issue
Block a user