Files
splitt-the-bill/app/composables/useIdentity.ts
T
anbraten 99a9f908f1
tinyedge/deploy Deployed by TinyEdge
move tabs into own pages
2026-08-07 15:49:43 +02:00

16 lines
341 B
TypeScript

export function useIdentity() {
const name = useCookie<string | null>('stb-identity-name', {
default: () => null,
maxAge: 60 * 60 * 24 * 365,
sameSite: 'lax',
});
function setName(newName: string) {
const trimmed = newName.trim();
if (!trimmed) return;
name.value = trimmed;
}
return { name, setName };
}