Release v2.4.2
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Error page route helpers and error copy selection.
|
||||
|
||||
const { renderView } = require('../view');
|
||||
const { renderView } = require('#src/web/view');
|
||||
const { PERMISSION_DENIED_MESSAGE } = require('#src/rbac');
|
||||
|
||||
function getErrorCopy(statusCode, message) {
|
||||
const normalizedStatusCode = Number(statusCode) || 500;
|
||||
@@ -9,7 +10,7 @@ function getErrorCopy(statusCode, message) {
|
||||
return {
|
||||
title: 'Access denied',
|
||||
errorTitle: 'Access denied',
|
||||
errorMessage: message || 'You do not have permission to access this area.',
|
||||
errorMessage: message || PERMISSION_DENIED_MESSAGE,
|
||||
backLabel: 'Back to dashboard'
|
||||
};
|
||||
}
|
||||
@@ -47,7 +48,7 @@ module.exports = function renderErrorPage(options, currentUser) {
|
||||
return renderView('error/error', {
|
||||
title: String(errorOptions.title || copy.title || 'Error').trim(),
|
||||
active: '',
|
||||
messageVariant: 'primary',
|
||||
messageVariant: statusCode === 403 ? 'warning' : 'primary',
|
||||
currentUser: currentUser || null,
|
||||
statusCode: statusCode,
|
||||
errorTitle: String(errorOptions.errorTitle || copy.errorTitle || errorOptions.title || 'Error').trim(),
|
||||
|
||||
Reference in New Issue
Block a user