You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi dear friend @mohammad-fouladgar@50bhan@MizouziE
I used the package that you took pains to write and came across the following things that I think are bugs and it is very important.
The first thing is that in the config: token_length and token_lifetime are set to OTP_TOKEN_LENGTH, which should be separate
The second case is in the approval of the OTP use code : I have set the token_lifetime parameter to 2 minutes and it is stored correctly in the database, but when validating it, it allows login even though its time has expired.
public function verifyOtp()
{
try {
$user= OTP()->useProvider('users')->validate($this->mobile,$this->token);
Auth::loginUsingId($user->id);
$this->emit('showAlert','ورود موفق');
return redirect()->route('panel.dashboard.index');
} catch (InvalidOTPTokenException $exception){
$this->emit('showAlert',"توکن منقضی شده یا نامعتبر است.",'متاسفیم','error');
$this->emit('verfiyOtp',['mobile' => $this->mobile]);
} catch (Throwable $ex) {
$this->emit('showAlert', 'کد وارد شده صحیح نمیباشد','متاسفیم!','error');
$this->emit('verfiyOtp',['mobile' => $this->mobile]);
}
}
I use livewire and that's why I used this method
Because OTPService could not be defined in the mount method.
The text was updated successfully, but these errors were encountered:
Hi dear friend @mohammad-fouladgar @50bhan @MizouziE
I used the package that you took pains to write and came across the following things that I think are bugs and it is very important.
The first thing is that in the config:
token_length and token_lifetime are set to OTP_TOKEN_LENGTH, which should be separate
The second case is in the approval of the OTP use code :
I have set the token_lifetime parameter to 2 minutes and it is stored correctly in the database, but when validating it, it allows login even though its time has expired.
I use livewire and that's why I used this method
Because OTPService could not be defined in the mount method.
The text was updated successfully, but these errors were encountered: