It does not increment the no_times_attempt
Closed this issue · 3 comments
sahilsethchd commented
while we attempt
$verify = Otp::validate($identifier, $otp->token);
It does not increment no_times_attempt field in table.
The code is in OtpGenerator.php is in validate()
if ($otp->token == $token) {
return (object) [
'status' => true,
'message' => 'OTP is valid',
];
}
$otp->increment('no_times_attempted');
but it should be like below for proper functioning:
if ($otp->token == $token) {
$otp->increment('no_times_attempted');
return (object) [
'status' => true,
'message' => 'OTP is valid',
];
}
seshac commented
no_times_attempted will increment for failed attempted as well. thanks.
sahilsethchd commented
So you updated the code, right.
seshac commented
Yes!