diff --git a/app/Livewire/BillingPortal/Authentication/RegisterOrLogin.php b/app/Livewire/BillingPortal/Authentication/RegisterOrLogin.php index 3034b1fb0fd7..5b3c32c43dfa 100644 --- a/app/Livewire/BillingPortal/Authentication/RegisterOrLogin.php +++ b/app/Livewire/BillingPortal/Authentication/RegisterOrLogin.php @@ -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}";