Cache session data
The session is always explicitly updated when it changes, cache it on the client if it has already been loaded.
This commit is contained in:
parent
ed74f4bb0e
commit
2897542823
1 changed files with 3 additions and 0 deletions
|
@ -2,5 +2,8 @@ export const useAccountSession = () => useFetch(
|
||||||
"/api/auth/session",
|
"/api/auth/session",
|
||||||
{
|
{
|
||||||
transform: (input) => input === undefined ? false : input,
|
transform: (input) => input === undefined ? false : input,
|
||||||
|
getCachedData(key, nuxtApp) {
|
||||||
|
return nuxtApp.payload.data[key];
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue