summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/errors.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/errors.js b/lib/errors.js
index f86e8aa3..950b4cae 100644
--- a/lib/errors.js
+++ b/lib/errors.js
@@ -7,8 +7,10 @@ module.exports = {
responseError(res, '403', 'Forbidden', 'oh no.')
} else {
if (!req.session) req.session = {}
- req.session.returnTo = req.originalUrl || config.serverUrl + '/'
- req.flash('error', 'You are not allowed to access this page. Maybe try logging in?')
+ if (req.originalUrl !== '/403') {
+ req.session.returnTo = config.serverURL + (req.originalUrl || '/')
+ req.flash('error', 'You are not allowed to access this page. Maybe try logging in?')
+ }
res.redirect(config.serverURL + '/')
}
},