traxxx-web/pages/admin/+onBeforeRender.js

14 lines
275 B
JavaScript
Raw Normal View History

import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
export function onBeforeRender(pageContext) {
if (pageContext.user.role === 'user') {
throw render(404);
}
return {
pageContext: {
title: pageContext.routeParams.section,
},
};
}