From 9fedea920cc8e9a950518335cce02204bead366a Mon Sep 17 00:00:00 2001 From: Bruce Schultz Date: Mon, 9 Mar 2026 09:37:41 +0100 Subject: [PATCH 1/3] build(ssr): fix ssr bug --- nuxt.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 9d8ad16..dd3b9e1 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,7 +4,7 @@ import { Flame } from "./app/assets/primevue/flame-preset"; import tailwindcss from "@tailwindcss/vite"; export default defineNuxtConfig({ - ssr: false, + ssr: process.env.NODE_ENV !== "development", devtools: { enabled: false }, modules: ["@primevue/nuxt-module", "@sidebase/nuxt-auth", "@pinia/nuxt"], @@ -31,7 +31,7 @@ export default defineNuxtConfig({ originEnvKey: "NUXT_PUBLIC_ORIGIN", baseURL: process.env.NUXT_PUBLIC_ORIGIN || "http://localhost:3000/flame/api/auth", - disableServerSideAuth: false, + disableServerSideAuth: true, // Not needed since globalAppMiddleware is enabled globalAppMiddleware: true, provider: { type: "authjs", From 0c7c738b49fb23021a33d4f68167eca5f4934f4b Mon Sep 17 00:00:00 2001 From: Bruce Schultz Date: Mon, 9 Mar 2026 11:28:05 +0100 Subject: [PATCH 2/3] fix(ssr): make avatar items computed refs --- app/components/header/AvatarButton.vue | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/components/header/AvatarButton.vue b/app/components/header/AvatarButton.vue index d89e9c7..0a9641d 100644 --- a/app/components/header/AvatarButton.vue +++ b/app/components/header/AvatarButton.vue @@ -17,22 +17,17 @@ const idpProvider = config.public.idpProvider; const isAuthenticated = computed(() => authStatus.value === "authenticated"); -const userActionLabel = isAuthenticated.value ? "Logout" : "Login"; -const userActionIcon = isAuthenticated.value - ? "pi pi-sign-in" - : "pi pi-sign-out"; - const toggle = (event) => { menu.value.toggle(event); }; -const menuItems = ref([ +const menuItems = computed(() => [ { label: "Options", items: [ { - label: userActionLabel, - icon: userActionIcon, + label: isAuthenticated.value ? "Logout" : "Login", + icon: isAuthenticated.value ? "pi pi-sign-in" : "pi pi-sign-out", command: () => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions isAuthenticated.value ? signOut() : signIn(`${idpProvider}`); From e35d3151736830a6684a4d7faa87420a84693bb2 Mon Sep 17 00:00:00 2001 From: Bruce Schultz Date: Mon, 9 Mar 2026 12:56:07 +0100 Subject: [PATCH 3/3] perf: handle when authetication is loading --- app/components/header/AvatarButton.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/header/AvatarButton.vue b/app/components/header/AvatarButton.vue index 0a9641d..3e090cd 100644 --- a/app/components/header/AvatarButton.vue +++ b/app/components/header/AvatarButton.vue @@ -27,7 +27,7 @@ const menuItems = computed(() => [ items: [ { label: isAuthenticated.value ? "Logout" : "Login", - icon: isAuthenticated.value ? "pi pi-sign-in" : "pi pi-sign-out", + icon: isAuthenticated.value ? "pi pi-sign-out" : "pi pi-sign-in", command: () => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions isAuthenticated.value ? signOut() : signIn(`${idpProvider}`); @@ -79,6 +79,7 @@ const menuItems = computed(() => [ @click="toggle" /> +