Skip to content

Commit 0efdfba

Browse files
committed
fix: (LAR-77) Authentication view and tests
1 parent 54d4378 commit 0efdfba

File tree

12 files changed

+69
-343
lines changed

12 files changed

+69
-343
lines changed

app/Livewire/Forms/LoginForm.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace App\Livewire\Forms;
46

57
use Illuminate\Auth\Events\Lockout;
@@ -10,7 +12,7 @@
1012
use Livewire\Attributes\Validate;
1113
use Livewire\Form;
1214

13-
class LoginForm extends Form
15+
final class LoginForm extends Form
1416
{
1517
#[Validate('required|string|email')]
1618
public string $email = '';

app/Providers/VoltServiceProvider.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99

1010
final class VoltServiceProvider extends ServiceProvider
1111
{
12-
public function register(): void
13-
{
14-
15-
}
12+
public function register(): void {}
1613

1714
public function boot(): void
1815
{

resources/views/components/input-error.blade.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

resources/views/components/primary-button.blade.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

resources/views/livewire/pages/auth/login.blade.php

Lines changed: 65 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use App\Livewire\Forms\LoginForm;
66
use Illuminate\Support\Facades\Session;
7-
use Livewire\Attributes\Layout;
7+
use Livewire\Attributes\Title;
88
use Livewire\Volt\Component;
99
1010
new class extends Component
@@ -23,78 +23,75 @@ public function login(): void
2323
}
2424
}; ?>
2525

26-
<div>
27-
<x-container class="flex min-h-full items-center justify-center py-16 sm:pt-24">
28-
<div class="w-full max-w-md space-y-8">
29-
<div>
30-
<x-validation-errors />
31-
<h2 class="text-center font-heading text-3xl font-extrabold text-gray-900 dark:text-white">
32-
{{ __('pages/auth.login.title') }}
33-
</h2>
34-
</div>
35-
<form class="space-y-6" wire:submit="login">
36-
@csrf
37-
<div class="space-y-4">
38-
<x-filament::input.wrapper>
39-
<x-filament::input
40-
type="text"
41-
id="email-address"
42-
name="email"
43-
autocomplete="email"
44-
required="true"
45-
wire:model="form.email"
46-
aria-label="{{ __('validation.attributes.email') }}"
47-
:placeholder="__('validation.attributes.email')"
48-
/>
49-
</x-filament::input.wrapper>
50-
<x-filament::input.wrapper>
51-
<x-filament::input
52-
type="password"
53-
id="password"
54-
name="password"
55-
required="true"
56-
wire:model="form.password"
57-
aria-label="{{ __('validation.attributes.password') }}"
58-
:placeholder="__('validation.attributes.password')"
59-
/>
60-
</x-filament::input.wrapper>
61-
</div>
26+
<div>
27+
<x-container class="flex min-h-full items-center justify-center py-16 sm:pt-24">
28+
<div class="w-full max-w-md space-y-8">
29+
<div>
30+
<x-validation-errors />
6231

63-
<div class="flex items-center justify-between">
64-
<div class="flex items-center">
65-
<label class="inline-flex items-center gap-2 cursor-pointer text-sm text-gray-500 dark:text-gray-400">
66-
<x-filament::input.checkbox id="remember_me" name="remember_me" />
67-
{{ __('pages/auth.login.remember_me') }}
68-
</label>
69-
</div>
32+
<h2 class="text-center font-heading text-3xl font-extrabold text-gray-900 dark:text-white">
33+
{{ __('pages/auth.login.title') }}
34+
</h2>
35+
</div>
36+
<form class="space-y-6" wire:submit="login">
37+
@csrf
38+
<div class="space-y-4">
39+
<x-filament::input.wrapper>
40+
<x-filament::input
41+
type="text"
42+
id="email-address"
43+
name="email"
44+
autocomplete="email"
45+
required="true"
46+
wire:model="form.email"
47+
aria-label="{{ __('validation.attributes.email') }}"
48+
:placeholder="__('validation.attributes.email')"
49+
/>
50+
</x-filament::input.wrapper>
51+
<x-filament::input.wrapper>
52+
<x-filament::input
53+
type="password"
54+
id="password"
55+
name="password"
56+
required="true"
57+
wire:model="form.password"
58+
aria-label="{{ __('validation.attributes.password') }}"
59+
:placeholder="__('validation.attributes.password')"
60+
/>
61+
</x-filament::input.wrapper>
62+
</div>
7063

71-
<div class="text-sm">
72-
<x-link
73-
:href="route('password.request')"
74-
class="font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white"
75-
>
76-
{{ __('pages/auth.login.forgot_password') }}
77-
</x-link>
78-
</div>
64+
<div class="flex items-center justify-between">
65+
<div class="flex items-center">
66+
<label class="inline-flex items-center gap-2 cursor-pointer text-sm text-gray-500 dark:text-gray-400">
67+
<x-filament::input.checkbox id="remember_me" name="remember_me" />
68+
{{ __('pages/auth.login.remember_me') }}
69+
</label>
7970
</div>
8071

81-
<div>
82-
<x-buttons.primary type="submit" class="group relative w-full">
83-
<span class="absolute pointer-events-none inset-y-0 left-0 flex items-center pl-3">
84-
<x-untitledui-lock class="size-5 text-green-500 group-hover:text-green-600" aria-hidden="true" />
85-
</span>
86-
{{ __('pages/auth.login.submit') }}
87-
</x-buttons.primary>
72+
<div class="text-sm">
73+
<x-link
74+
:href="route('password.request')"
75+
class="font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white"
76+
>
77+
{{ __('pages/auth.login.forgot_password') }}
78+
</x-link>
8879
</div>
89-
</form>
90-
91-
@include('partials._socials-link')
92-
</div>
93-
</x-container>
94-
95-
<x-join-sponsors :title="__('global.sponsor_thanks')" />
96-
</div>
97-
80+
</div>
9881

82+
<div>
83+
<x-buttons.primary type="submit" class="group relative w-full">
84+
<span class="absolute pointer-events-none inset-y-0 left-0 flex items-center pl-3">
85+
<x-untitledui-lock class="size-5 text-green-500 group-hover:text-green-600" aria-hidden="true" />
86+
</span>
87+
{{ __('pages/auth.login.submit') }}
88+
</x-buttons.primary>
89+
</div>
90+
</form>
9991

92+
@include('partials._socials-link')
93+
</div>
94+
</x-container>
10095

96+
<x-join-sponsors :title="__('global.sponsor_thanks')" />
97+
</div>

tests/Feature/Auth/AuthenticationTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@
4545
$this->assertGuest();
4646
});
4747

48-
test('navigation menu can be rendered', function (): void {
49-
$user = User::factory()->create();
50-
51-
$this->actingAs($user);
52-
53-
$response = $this->get('/dashboard');
54-
55-
$response
56-
->assertOk()
57-
->assertSeeVolt('layout.navigation');
58-
});
59-
6048
test('users can logout', function (): void {
6149
$user = User::factory()->create();
6250

tests/Feature/Auth/EmailVerificationTest.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

tests/Feature/Auth/LoginTest.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/Feature/Auth/PasswordConfirmationTest.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

tests/Feature/Auth/PasswordResetTest.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)