Initial work, copied from the Shopify provider

This commit is contained in:
Patryk Zawadzki
2021-04-14 14:09:40 +02:00
committed by Zaiste
parent 685fb932db
commit ffe5a1c20e
79 changed files with 16981 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import Cookies, { CookieAttributes } from 'js-cookie'
export const getCustomerToken = () => Cookies.get('saleorAccessToken')
export const setCustomerToken = (
token: string | null,
options?: CookieAttributes
) => {
if (!token) {
Cookies.remove('saleorAccessToken')
} else {
Cookies.set(
'saleorAccessToken',
token,
options ?? {
expires: 60 * 60 * 24 * 30,
}
)
}
}