in src/utils/localStorageWithExpiry.ts [1:9]
export function setLocalStorageWithExpiry(key: string, value: string, ttl: number) {
const now = new Date();
const item = {
expiry: now.getTime() + ttl,
value,
};
localStorage.setItem(key, JSON.stringify(item));
}