From f10c3da10b7f028ff854228e0273af15922c5404 Mon Sep 17 00:00:00 2001 From: Sebastian Di Luzio Date: Sun, 10 Sep 2023 11:21:59 +0200 Subject: [PATCH] Revert "refactor: deal with default profile by not redirecting" This reverts commit a8062271688648bf93bc916bed52e8b3dc7066aa. --- middleware/defaultPage.global.ts | 8 ++++++++ pages/index.vue | 16 ---------------- 2 files changed, 8 insertions(+), 16 deletions(-) create mode 100644 middleware/defaultPage.global.ts delete mode 100644 pages/index.vue diff --git a/middleware/defaultPage.global.ts b/middleware/defaultPage.global.ts new file mode 100644 index 00000000..86b6ff5a --- /dev/null +++ b/middleware/defaultPage.global.ts @@ -0,0 +1,8 @@ +import { defaultProfile } from '~/constants/defaultProfile'; + +export default defineNuxtRouteMiddleware((to /* , from */) => { + // Default to the default profile if no profile is specified + if (to.path === '/') { + return navigateTo(`/${defaultProfile}`); + } +}); diff --git a/pages/index.vue b/pages/index.vue deleted file mode 100644 index 00cf5eaf..00000000 --- a/pages/index.vue +++ /dev/null @@ -1,16 +0,0 @@ - - -