-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No such entity with customerId = 2 #115
Comments
Hello @irnjunior sorry for replying bit late, but can we discuss about the issue, if it's possible |
Hi. |
Regarding customer isn't authorized to access the resources, did you follow all the instructions explained here in wiki especially these two
4. Increase customer session expiry timeBy default, customer token generated when user login is valid for 1 hour. You can change these values from Admin by selecting Stores > Settings > Configuration > Services > OAuth > Access Token Expiration.
|
I followed all the procedures correctly. I can create and login with the client normally through the application. I add a product to the shopping cart and at that moment the message "Current Customer Does Not Have An Active Cart" is displayed. Then, when you click on the cart icon a red message is displayed "No such entity with customerId = 2" If I create a client account directly through the browser, these errors will not appear. These errors appear only when I create an account through the app. Any idea how to fix this? |
Ok, I understand, let me test tomorrow with my own local magento setup. Will let you know |
hi @irnjunior I tested it with my local magento 2.4 setup, and created new account, at my end, I am able to add products to cart. See, one you log in, customer cart is fetched, but since, a new user, doesn't have customer cart, an error is thrown, so in app, it is handled to request quote cart, which create a cart for customer, and again customer cart is fetched. // wroker saga: Add description
function* getCustomerCart() {
try {
yield put({ type: MAGENTO.CUSTOMER_CART_LOADING });
const cart = yield call({
content: magento,
fn: magento.customer.getCustomerCart,
});
yield put({ type: MAGENTO.CUSTOMER_CART_SUCCESS, payload: { cart } });
} catch (error) {
yield put({
type: MAGENTO.CUSTOMER_CART_FAILURE,
payload: { errorMessage: error.message },
});
if (error.message.startsWith('No such entity with')) {
yield put({ type: MAGENTO.CREATE_QUOTE_ID_REQUEST }); // <============== look here
}
}
} This is like a hack, and possibly the problem is occurring here. Follow these steps
Your console should look something like this, in this order for new account first time login |
I did the installation and the application works normally. I registered a user through the application normally.
However, when I try to add a product to the cart, the following message appears: "The consumer isn't authorized to access resource."
When I click on the cart icon, the following message is displayed: "No such entity with customerId = 2"
I'm using Magento 2.4
The text was updated successfully, but these errors were encountered: