Skip to content

Conversation

@roccopm
Copy link
Contributor

@roccopm roccopm commented Jan 1, 2026

Changes made

Will add more PR detail closer to completion, just throwing this up for visibility in case anything fundamental needs changed early on.

Screenshots

When logged in as admin:
image
image
image

When not logged in (similar if logged in as non-admin, but shows 403 forbidden instead):
image

Comment on lines +14 to +26
else {
throw createError({
statusCode: 401,
statusMessage: "Unauthorized",
});
}
if (!userRoles.includes("admin")) {
throw createError({
statusCode: 403,
statusMessage: "Forbidden",
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these will work correctly when using client-side only rendering, we should probably use middleware instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this by adding ssr: false to nuxt.config.ts and the page appears to render fine client-only (for both logged in and non-logged in with the errors). I can't find anything online or in the docs about this being an issue.
https://nuxt.com/docs/4.x/getting-started/error-handling#createerror

I'll leave this unresolved until I've done more research and testing and will come back to it

Also added POST for roles, not in use yet though
UI is functional but very ugly, holding off on fleshing this out until I know what all the page content will be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants