mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
ability to redirect the user from anywhere
just send
```
callback({
status: 302,
path: '/user/psychobunny'
});
```
This commit is contained in:
@@ -211,6 +211,10 @@ function handleErrors(app, middleware) {
|
|||||||
return res.sendStatus(403);
|
return res.sendStatus(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parseInt(err.status, 10) === 302 && err.path) {
|
||||||
|
return res.locals.isAPI ? res.status(302).json(err) : res.redirect(err.path);
|
||||||
|
}
|
||||||
|
|
||||||
res.status(err.status || 500);
|
res.status(err.status || 500);
|
||||||
|
|
||||||
if (res.locals.isAPI) {
|
if (res.locals.isAPI) {
|
||||||
|
|||||||
Reference in New Issue
Block a user