From 9cf81c7ad45b2c337838d559f1c0e238a05341a8 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Wed, 15 Nov 2023 20:29:14 -0600 Subject: [PATCH] cleanup, validation --- app/Http/Livewire/PersonalAccessTokens.php | 3 +- .../view-new-token.blade.php | 29 ------------------- .../livewire/personal-access-tokens.blade.php | 15 +++++----- 3 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 resources/views/components/personal-access-tokens/view-new-token.blade.php diff --git a/app/Http/Livewire/PersonalAccessTokens.php b/app/Http/Livewire/PersonalAccessTokens.php index 03d2cb7f24..545202580b 100644 --- a/app/Http/Livewire/PersonalAccessTokens.php +++ b/app/Http/Livewire/PersonalAccessTokens.php @@ -23,12 +23,13 @@ class PersonalAccessTokens extends Component { return [ 'name' => 'required|string|max:255', - 'scopes' => 'nullable|array', ]; } public function createToken(): void { + $this->validate(); + $newToken = Auth::user()->createToken($this->name); $this->newTokenString = $newToken->accessToken; diff --git a/resources/views/components/personal-access-tokens/view-new-token.blade.php b/resources/views/components/personal-access-tokens/view-new-token.blade.php deleted file mode 100644 index a211747be4..0000000000 --- a/resources/views/components/personal-access-tokens/view-new-token.blade.php +++ /dev/null @@ -1,29 +0,0 @@ - \ No newline at end of file diff --git a/resources/views/livewire/personal-access-tokens.blade.php b/resources/views/livewire/personal-access-tokens.blade.php index edc4caaeff..4781d18256 100644 --- a/resources/views/livewire/personal-access-tokens.blade.php +++ b/resources/views/livewire/personal-access-tokens.blade.php @@ -72,17 +72,15 @@