mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
16 lines
327 B
JavaScript
16 lines
327 B
JavaScript
|
|
import Cookies from 'js-cookie'
|
|
|
|
const getCustomerCookie = () => {
|
|
const customerCookieObj = Cookies.get('customer_token');
|
|
if(customerCookieObj) {
|
|
try {
|
|
return JSON.parse(atob(customerCookieObj));
|
|
} catch(err) {
|
|
return false;
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
export default getCustomerCookie; |