diff --git a/app/Livewire/Portal/Tokens/TokenIndex.php b/app/Livewire/Portal/Tokens/TokenIndex.php index 11aa5b8..4bf45cd 100644 --- a/app/Livewire/Portal/Tokens/TokenIndex.php +++ b/app/Livewire/Portal/Tokens/TokenIndex.php @@ -37,17 +37,17 @@ public function getExpirationOptions(): array */ public function createToken(): void { - $this->validate([ - 'tokenName' => ['required', 'string', 'min:3', 'max:255'], - 'tokenExpiration' => ['required', 'integer', 'in:7,30,90,180'], - ]); - $user = auth()->user(); - if (! $user) { + if (! $user || ! $user->hasVerifiedEmail()) { return; } + $this->validate([ + 'tokenName' => ['required', 'string', 'min:3', 'max:255'], + 'tokenExpiration' => ['required', 'integer', 'in:7,30,90,180'], + ]); + $expiresAt = now()->addDays($this->tokenExpiration); $token = $user->createToken($this->tokenName, ['*'], $expiresAt); diff --git a/resources/views/portal/components/layouts/guest.blade.php b/resources/views/portal/components/layouts/guest.blade.php index 84b948d..61c8ea2 100644 --- a/resources/views/portal/components/layouts/guest.blade.php +++ b/resources/views/portal/components/layouts/guest.blade.php @@ -29,7 +29,7 @@ @fluxAppearance -
+ {{ config('app.name') }} API @@ -38,7 +38,7 @@ {{ $slot }} -
+ diff --git a/resources/views/portal/livewire/auth/login.blade.php b/resources/views/portal/livewire/auth/login.blade.php index c2d2f22..8864021 100644 --- a/resources/views/portal/livewire/auth/login.blade.php +++ b/resources/views/portal/livewire/auth/login.blade.php @@ -1,4 +1,4 @@ - +
Sign in to your account @@ -30,4 +30,4 @@ Sign in - +
diff --git a/resources/views/portal/livewire/auth/register.blade.php b/resources/views/portal/livewire/auth/register.blade.php index ea5510a..a98852a 100644 --- a/resources/views/portal/livewire/auth/register.blade.php +++ b/resources/views/portal/livewire/auth/register.blade.php @@ -1,4 +1,4 @@ - +
Create your account @@ -59,4 +59,4 @@ Create account - +
diff --git a/resources/views/portal/livewire/auth/verify-email.blade.php b/resources/views/portal/livewire/auth/verify-email.blade.php index 31021dd..9026e41 100644 --- a/resources/views/portal/livewire/auth/verify-email.blade.php +++ b/resources/views/portal/livewire/auth/verify-email.blade.php @@ -1,4 +1,4 @@ - +
Verify your email @@ -7,10 +7,8 @@
- - - If you didn't receive the email, check your spam folder or click the button below to resend. - + + If you didn't receive the email, check your spam folder or click the button below to resend. @@ -22,4 +20,4 @@ Skip for now
-
+
diff --git a/resources/views/portal/livewire/resources/resource-index.blade.php b/resources/views/portal/livewire/resources/resource-index.blade.php index 9cff1b5..ccee55b 100644 --- a/resources/views/portal/livewire/resources/resource-index.blade.php +++ b/resources/views/portal/livewire/resources/resource-index.blade.php @@ -1,5 +1,4 @@ - Home Resources diff --git a/resources/views/portal/livewire/stats/api-stats.blade.php b/resources/views/portal/livewire/stats/api-stats.blade.php index 35e04be..1fe0cfc 100644 --- a/resources/views/portal/livewire/stats/api-stats.blade.php +++ b/resources/views/portal/livewire/stats/api-stats.blade.php @@ -1,5 +1,4 @@ - Home Statistics diff --git a/resources/views/portal/livewire/stats/index.blade.php b/resources/views/portal/livewire/stats/index.blade.php index 3e64f64..ef75edb 100644 --- a/resources/views/portal/livewire/stats/index.blade.php +++ b/resources/views/portal/livewire/stats/index.blade.php @@ -1,5 +1,4 @@ - Home Statistics diff --git a/resources/views/portal/livewire/stats/recipe-stats.blade.php b/resources/views/portal/livewire/stats/recipe-stats.blade.php index 979a935..0163818 100644 --- a/resources/views/portal/livewire/stats/recipe-stats.blade.php +++ b/resources/views/portal/livewire/stats/recipe-stats.blade.php @@ -1,5 +1,4 @@ - Home Statistics diff --git a/resources/views/portal/livewire/stats/user-stats.blade.php b/resources/views/portal/livewire/stats/user-stats.blade.php index b5dec24..6e817e7 100644 --- a/resources/views/portal/livewire/stats/user-stats.blade.php +++ b/resources/views/portal/livewire/stats/user-stats.blade.php @@ -1,5 +1,4 @@ - Home Statistics diff --git a/resources/views/portal/livewire/tokens/index.blade.php b/resources/views/portal/livewire/tokens/index.blade.php index 3f73322..c07110b 100644 --- a/resources/views/portal/livewire/tokens/index.blade.php +++ b/resources/views/portal/livewire/tokens/index.blade.php @@ -1,9 +1,18 @@ - + @if(! auth()->user()->hasVerifiedEmail()) + + Email Verification Required + + You must verify your email address before creating API tokens. + Verify now + + + @endif +
API Tokens - - + + Create Token @@ -33,8 +42,8 @@ Create your first API token to start making authenticated requests.
- - + + Create Token