mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add check for existing client contact in withOtp() method
This commit is contained in:
parent
e3f1520ba9
commit
02e8201b10
@ -95,6 +95,16 @@ class RegisterOrLogin extends Component
|
||||
|
||||
public function withOtp()
|
||||
{
|
||||
$contact = ClientContact::where('email', $this->email)
|
||||
->where('company_id', $this->subscription->company_id)
|
||||
->first();
|
||||
|
||||
if ($contact === null) {
|
||||
$this->state['register_form'] = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$code = rand(100000, 999999);
|
||||
$email_hash = "subscriptions:otp:{$this->email}";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user