We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a258719 + 99abac3 commit 12ab900Copy full SHA for 12ab900
1 file changed
lib/response.js
@@ -17,7 +17,13 @@ var utils = require('./utils')
17
// public
18
var response = {
19
errorForbidden: function (res) {
20
- responseError(res, '403', 'Forbidden', 'oh no.')
+ const {req} = res
21
+ if (req.user) {
22
+ responseError(res, '403', 'Forbidden', 'oh no.')
23
+ } else {
24
+ req.flash('error', 'You are not allowed to access this page. Maybe try logging in?')
25
+ res.redirect(config.serverURL)
26
+ }
27
},
28
errorNotFound: function (res) {
29
responseError(res, '404', 'Not Found', 'oops.')
0 commit comments