commerce/framework/elasticpath/utils/get-customer-creds.js
GunaTrika c5d92d46ad Adding Moltin SDK for client side
Adding get user using sdk
2021-07-28 15:53:19 +05:30

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;