This commit is contained in:
NotII
2025-03-03 20:44:10 +00:00
parent cd35d34a24
commit 5260978cb8
4 changed files with 19 additions and 6 deletions

View File

@@ -26,4 +26,14 @@ export async function clientFetch(url: string, options: RequestInit = {}): Promi
console.error(`Client fetch error at ${url}:`, error);
throw error;
}
}
/**
* Get a cookie value by name
*/
export function getCookie(name: string): string | undefined {
return document.cookie
.split('; ')
.find(row => row.startsWith(`${name}=`))
?.split('=')[1];
}