Wrong Attempts count and resend the OTP

Hi Team,

We are using passwordless authentication and there is requirement that after 3 wrong OTP attempts we need to resend the OTP.

Is there a way to configure this kind of option to send the new OTP after x number of wrong attempts.

Thanks in advance for your kind help.