Skip to content

Commit

Permalink
set status code on error
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Oct 30, 2024
1 parent 230b53b commit 124c379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/middleware/admin.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default defineNuxtRouteMiddleware(async (to, from) => {
const currentUser = useCurrentUser();
if (!currentUser.props?.admin) {
return abortNavigation('You must be an admin to view this.');
return abortNavigation({ statusCode: 403, fatal: true, message: 'You must be an admin to view this.' });
}
});

0 comments on commit 124c379

Please sign in to comment.