-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add GraphQL mutations for Reset password for MyAccount #27876
Conversation
Hi @Usik2203. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Usik2203. Good job. Please, check my comments below.
/** | ||
* @var AccountManagementInterface | ||
*/ | ||
protected $customerAccountManagement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use the private
scope for properties that are not supposed to be inherited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also applies to all other cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
$args['email'], | ||
AccountManagement::EMAIL_RESET | ||
); | ||
} catch (\Exception $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious. Is there some unhandled exception in the flow? If it is so, we should not simply return false
but throw LocalizedException
instead.
But the main question is, do we have an unhandled exception somewhere in the middle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added LocalizedException
.
Yes, we have exceptions inside $this->customerAccountManagement->resetPassword()
and $this->customerAccountManagement->initiatePasswordReset()
these exceptions related with
- Checks if customer account is for this email
- Checks match token
- Checks length of password
$args['newPassword'] | ||
); | ||
} catch (\Exception $e) { | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, read my notice about catching the exception above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
/** | ||
* @expectedException \Exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do not use exception annotations like expectedException
and expectedExceptionMessage
. This approach is deprecated in PHPUnit. Feel free to use the corresponding methods instead (self::expectException
, self::expectExceptionMessage
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Also, may a ask you to squash all your commit into a single one and perform the force-push to this branch, please? Thank you |
Hi @rogyar |
@magento run WebAPI Tests |
Hi @slavvka, thank you for the review. |
Hi @Usik2203, thank you for your contribution! |
Description (*)
Related Pull Requests
Fixed Issues (if relevant)
Customer :: MyAccount :: Reset password for MyAccount
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)