mirror of
https://github.com/vercel/commerce.git
synced 2025-03-28 08:15:54 +00:00
13 lines
393 B
TypeScript
13 lines
393 B
TypeScript
import Cookies from 'js-cookie'
|
|
import { SHOPIFY_CUSTOMER_TOKEN_COOKIE } from '../const'
|
|
|
|
export const getCustomerToken = () => Cookies.get(SHOPIFY_CUSTOMER_TOKEN_COOKIE)
|
|
|
|
export const setCustomerToken = (token: string | null, options?: any) => {
|
|
if (!token) {
|
|
Cookies.remove(SHOPIFY_CUSTOMER_TOKEN_COOKIE)
|
|
} else {
|
|
Cookies.set(SHOPIFY_CUSTOMER_TOKEN_COOKIE, token, options)
|
|
}
|
|
}
|