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

14 lines
275 B
JavaScript
Raw Permalink 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,
},
};
}