magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Website restriction -> Private Sale: Login only, not preventing registration on GraphQL. #38007

Open ghezelbash opened 12 months ago

ghezelbash commented 12 months ago

Preconditions and environment

Steps to reproduce

  1. Go to Stores > Configuration > General > General > Website Restrictions
  2. Set Access Restriction (general/restriction/is_active) to 'Yes' and set Restriction Mode (general/restriction/mode) to Private Sale: Login Only
  3. Clear the config cache
  4. Send a createCustomer GraphQL request

Expected result

Raise the error message in response: "Can not register new customer due to restrictions are enabled."

Actual result

Customer created. (Registration working)

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 12 months ago

Hi @ghezelbash. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 12 months ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 11 months ago

Hi @ghezelbash,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance with EE edition and the issue is reproducible.Kindly refer the screenshots.

Steps to reproduce

Screenshot 2023-09-26 at 12 38 21 PM Screenshot 2023-09-26 at 12 38 03 PM Screenshot 2023-09-26 at 12 38 29 PM

When we enable Private Sales: Login Only Users cannot create an account in this mode but still we are able to create the customer account using graphql mutation.

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 11 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-9614 is successfully created for this GitHub issue.

m2-assistant[bot] commented 11 months ago

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Vasudev-22 commented 11 months ago

@magento I am working on this

Vasudev-22 commented 11 months ago

Hi @engcom-Bravo , I was fixed this issue in enterprise edition locally. I need an access to push the code in EE repo.

Restriction Enabled :- Yes

Screenshot 2023-10-03 at 1 01 51 PM

Code Fix : Path:- module-customer-graph-ql/etc/graphql/di.xml Add this code in di.xml file and check

 <type name="Magento\Customer\Model\AccountManagement">
      <plugin name="website_restriction_customermodel_account" type="Magento\WebsiteRestriction\Plugin\Model\AccountManagement" />
 </type>