commerce/framework/elasticpath/utils/get-customer-creds.js
GunaTrika b5051f50e4 Login & Token
- Changed the loging fetch
 - Store the token and user id in cookie
 - Ue the cookie to make user calls like get user
2021-09-28 10:32:22 +05:30

15 lines
316 B
JavaScript

import Cookies from 'js-cookie'
const getCustomerCookie = () => {
const customerCookieObj = Cookies.get("user_token");
if(customerCookieObj) {
try {
return JSON.parse(customerCookieObj);
} catch(err) {
return false;
}
} else {
return false;
}
}
export default getCustomerCookie;