Rename and refactor the types passed over the API to be based on an
entity that's either living or a tombstone. A living entity has a
deleted property that's either undefined or false, while a tombstone
has a deleted property set to true. All entities have a numeric id
and an updatedAt timestamp.
To sync entities, an array of replacements are passed around. Living
entities are replaced with tombstones when they're deleted. And
tombstones are replaced with living entities when restored.
Replace the convoluted useAccountSession composable with a pinia store
that in addition allows for the consolidation of all session related
functions to grouped into one module.
If a session is refreshed when accessed through /api/auth/session during
a SSR then the Set-Cookie header was lost. Pass this along to the
client in this case to keep the session alive.
Fix the inital server side load of the schedule not including crew only
items due to headers not being passed from the client to server side
request made to fetch the schedule.
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.
If the returned value of the fetched endpoint is blank that gets
converted to undefined, which confuses the request sharing between the
client and server causing the session to be requested on both sides.
Transform value to null if it's blank so that the session fetch is
de-duplicated.
Provide a basic account system with login and server side session store
identified by a cookie. Upon successful login a signed session cookie
is set by the server with the session stored on the server identifying
which account it is logged in as. The client uses a shared useFetch on
the session endpoint to identify if it's logged in and which account it
is logged in as, and refreshes this when loggin in or out.