From ed74f4bb0e09bae04dbac92db5bdd48bdda0ee46 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 8 Mar 2025 00:33:35 +0100 Subject: [PATCH] Use false instead of null for empty session The caching layer of Nuxt assumes no entry exists if it's nullish. This causes null to be treated as if the resource needs to be fetched. Use false instead. --- composables/session.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composables/session.ts b/composables/session.ts index 579b43f..1031183 100644 --- a/composables/session.ts +++ b/composables/session.ts @@ -1,6 +1,6 @@ export const useAccountSession = () => useFetch( "/api/auth/session", { - transform: (input) => input === undefined ? null : input, + transform: (input) => input === undefined ? false : input, } );