0

Is there any magento plugin that allows in the section of "password change" to restict the field "new password" not to accept values as in "current password"?

2 Answers 2

0

I've not used this module, but it looks simple and effective. It's only two years old and has been tested against 2.3.5. I glanced over the code quickly, and didn't see any reason it wouldn't work in 2.4.x; but I suppose you'd have to try it to see.

https://github.com/kirchbergerknorr/magento2-module-password-history

0

You can simply add observer before/after controller dispatch

events.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch_customer_account_createpassword">
        <observer name="restrict_password" instance="Gohil\Rajesh\Model\RestrictWebsite" />
    </event>
    <event name="controller_action_predispatch_customer_account_resetpasswordpost">
        <observer name="restrict_password" instance="Gohil\Rajesh\Model\RestrictWebsite" />
    </event>
</config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.