owltide/composables/session.ts
Hornwitser 2897542823 Cache session data
The session is always explicitly updated when it changes, cache it on
the client if it has already been loaded.
2025-03-08 00:34:46 +01:00

9 lines
215 B
TypeScript

export const useAccountSession = () => useFetch(
"/api/auth/session",
{
transform: (input) => input === undefined ? false : input,
getCachedData(key, nuxtApp) {
return nuxtApp.payload.data[key];
},
}
);