mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
closes #5847
This commit is contained in:
@@ -166,7 +166,13 @@ module.exports = function (middleware) {
|
|||||||
return next();
|
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;
|
req.session.forceLogin = 1;
|
||||||
if (res.locals.isAPI) {
|
if (res.locals.isAPI) {
|
||||||
res.status(401).json({});
|
res.status(401).json({});
|
||||||
|
|||||||
Reference in New Issue
Block a user