mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
- Changed the loging fetch - Store the token and user id in cookie - Ue the cookie to make user calls like get user
15 lines
316 B
JavaScript
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; |