From 31933a56fae554becbc36355de17620249296c2e Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 7 Jul 2021 15:24:23 -0700 Subject: [PATCH] Trying to get the login screen working --- app/Http/Livewire/LoginForm.php | 13 ++++++++----- resources/views/livewire/login-form.blade.php | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/Http/Livewire/LoginForm.php b/app/Http/Livewire/LoginForm.php index 7d10cb78ae..f4fe02f28f 100644 --- a/app/Http/Livewire/LoginForm.php +++ b/app/Http/Livewire/LoginForm.php @@ -38,11 +38,14 @@ class LoginForm extends Component $this->can_submit = false; } - $this->validateOnly($fields); - - $this->can_submit = true; - + $whatever = $this->validateOnly($fields); + //\Log::info(print_r($whatever,true)); + $errors = $this->getErrorBag(); + + $this->can_submit = $this->username !== "" && $this->password !== "" && !$errors->has('username') && !$errors->has('password') ; // wait, what? + + \Log::info("Oy - can we submit yet?!".$this->can_submit); } /** @@ -58,7 +61,7 @@ class LoginForm extends Component public function submitForm() { - $this->can_submit = true; + //$this->can_submit = true; if (auth()->attempt($this->validate())) { return redirect()->intended('/'); diff --git a/resources/views/livewire/login-form.blade.php b/resources/views/livewire/login-form.blade.php index d7cad82505..6561adc8e1 100644 --- a/resources/views/livewire/login-form.blade.php +++ b/resources/views/livewire/login-form.blade.php @@ -41,7 +41,7 @@ {{ trans('admin/users/table.username') }} - + @error('username') {{ $message }} @@ -53,7 +53,7 @@ {{ trans('admin/users/table.password') }} - + @error('password') {{ $message }}