aktueller stand
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export const CUSTOMER_COOKIE_NAME = "customer_jwt";
|
||||
|
||||
export function getCustomerTokenClient(): string | null {
|
||||
const match = document.cookie.match(new RegExp(`(?:^|; )${CUSTOMER_COOKIE_NAME}=([^;]*)`));
|
||||
return match ? decodeURIComponent(match[1]) : null;
|
||||
}
|
||||
|
||||
export function setCustomerTokenClient(token: string) {
|
||||
document.cookie = `${CUSTOMER_COOKIE_NAME}=${encodeURIComponent(token)}; path=/; max-age=${60 * 60 * 24 * 30}; SameSite=Lax`;
|
||||
}
|
||||
|
||||
export function clearCustomerTokenClient() {
|
||||
document.cookie = `${CUSTOMER_COOKIE_NAME}=; path=/; max-age=0`;
|
||||
}
|
||||
Reference in New Issue
Block a user