diff --git a/app/Http/Livewire/Auth/Login.php b/app/Http/Livewire/Auth/Login.php index 6c39c7a6..0b26baf9 100644 --- a/app/Http/Livewire/Auth/Login.php +++ b/app/Http/Livewire/Auth/Login.php @@ -29,10 +29,10 @@ public function rules() ]; } - public function updatedUserProfile($value) + public function login($value) { - if (isset($value['npub'])) { - $firstUser = User::query()->where('nostr', $value['npub'])->first(); + if ($value) { + $firstUser = User::query()->where('nostr', $value)->first(); if ($firstUser) { auth()->login($firstUser, true); diff --git a/resources/views/livewire/auth/login.blade.php b/resources/views/livewire/auth/login.blade.php index c6478830..76d484a2 100644 --- a/resources/views/livewire/auth/login.blade.php +++ b/resources/views/livewire/auth/login.blade.php @@ -27,7 +27,7 @@ class="flex justify-center space-x-4" }); await ndkUser.fetchProfile(); console.log(ndkUser); - this.userProfile = ndkUser.profile; + $wire.login(user.npub); } }); }