I am using plugin
<type name="Magento\Customer\Model\AccountManagement">
<plugin name="custom_change_reset_password_link_token"
type="Vendor\MobileApp\Plugin\AccountManagementPlugin"
sortOrder="10"
disabled="false"/>
</type>
and using Around on method aroundChangeResetPasswordLinkToken but problem is it is working on APIs but when I try to access the reset link on web it always gives me error
Your password reset link has expired.
Here is my implementation
/**
* @param AccountManagement $subject
* @param callable $proceed
* @param string $customerId
* @param string $newPasswordToken
* @return bool
*/
public function aroundChangeResetPasswordLinkToken(
AccountManagement $subject,
callable $proceed,
$customerId,
$newPasswordToken
) {
$customToken = ( string ) $this->random->getRandomNumber( 100000, 999999 );
return $proceed( $customerId, $customToken );
}
When I pass a 6 digits string directly it works for example
return $proceed( $customerId, "123456" );
IDK what's the issue please help, Thanks in Advanced