Fix GraphQL login as customer token not working for multi stores
Description (*)
When a magento install with more than one store tries to utilize the login as Customer GraphQl to get a token for any store other than the default store- an error is thrown for customers not being found even when they exist.
Manual testing scenarios (*)
- For any multi store implementation of Magento Run the following mutation with with a store other than the default: mutation{ generateCustomerTokenAsAdmin(input: { customer_email: "[email protected]" }){ customer_token } }
- Run the above mutation.
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All new or changed code is covered with unit/integration tests (if applicable)
- [x] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [x] All automated tests passed successfully (all builds are green)
Resolved issues:
- [x] resolves magento/magento2#35084: Fix GraphQL login as customer token not working for multi stores
Hi @fiifiappiah. Thank you for your contribution Here are some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:
-
@magento give me test instance- deploy test instance based on PR changes -
@magento give me 2.4-develop instance- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
-
@magento run all tests- run or re-run all required tests against the PR changes -
@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names. Allowed build names are:
-
Database Compare -
Functional Tests CE -
Functional Tests EE, -
Functional Tests B2B -
Integration Tests -
Magento Health Index -
Sample Data Tests CE -
Sample Data Tests EE -
Sample Data Tests B2B -
Static Tests -
Unit Tests -
WebAPI Tests -
Semantic Version Checker
You can find more information about the builds here
:information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Magento Contributor Guide documentation.
:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.
@magento create issue
Hi @shikhamis11,
Thank you for your contribution!
Can you please do the code review so that we can move this PR further towards merging.
Thank you!
Hi @fiifiappiah,
Thank you for your contribution!
It seems that the issue has been resolved in commit on 2.4-develop
I have also tried to reproduce this issue by following ways:
- Created multistore magento instance.
- Created new users on different store with "Allow remote shopping assistance"
- Tried to execute mutation: mutation{ generateCustomerTokenAsAdmin(input: { customer_email: "[email protected]" }){ customer_token } }
Observed that, generateCustomerTokenAsAdmin mutation is working fine as expected by providing the token.
On the basis of above findings and since the issue is now not reproducible on 2.4-develop branch closing this PR.
Please reopen and update if you wish to continue.
Thank you for your contribution!