fix: server-only project middleware (#5538)
* fix(navigation): use replaceState for project filters to prevent history pollution * fix: add replace prop to NavTabs and enable it on project and discover pages * style: run pnpm run fix on affected files * enable NavTabs replace prop on collection, user, and org pages * fix: guard project middleware on client * fix: lint --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer> Co-authored-by: Truman Gao <106889354+tdgao@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,8 @@ const PROJECT_TYPES = [
|
||||
]
|
||||
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
// Only run this middleware on the server - it relies on server-only runtime config
|
||||
if (import.meta.client) return
|
||||
// Only handle project routes
|
||||
if (!to.params.id || !PROJECT_TYPES.includes(to.params.type as string)) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user