mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
Login, Sign Up, Log Out, and checkout & customer association
This commit is contained in:
12
framework/shopify/utils/customer-token.ts
Normal file
12
framework/shopify/utils/customer-token.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import Cookies from 'js-cookie'
|
||||
import { SHOPIFY_CUSTOMER_TOKEN_COOKIE } from '@framework/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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user