Added code to display error message from grapqhl response in form #4346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR contains the fix for customer login flow when require email confirmation is enabled.
Appropriate error message response from the graphql on customer creation will be shown in the form
This change requires few changes in Magento backend code.
Backend PR:
https://github.com/magento-commerce/magento2-pwa/pull/61
Closes #PWA-3367
https://jira.corp.adobe.com/browse/PWA-3367
Acceptance
Verification Stakeholders
Specification
Verification Steps
Step 1: Enable customer email confirmation from Magento Admin panel -> Stores -> Customer -> Customer Configuration -> Create New Account Options -> Require Emails Confirmation -> Yes and save the config
Step 2: In PWA store view add a product to cart and the go to Checkout page -> Sign In-> Create an account or Header -> Sign in -> Create an account
Step 3: Enter all the necessary details for the new customer account (Email should not exist already in the website)
Step 4: Click create an account button
Current result:
General error is thrown instead of more relevant error
(Error: An error has occurred. Please check the input and try again.)
Fix result:
Actual message from Magento graphql will be shown.
(Your account is created, You must confirm your account. Please check your email for the confirmation link.)
Screenshots / Screen Captures (if appropriate)
Breaking Changes (if any)
Checklist