Skip to content

Commit 8dd022f

Browse files
committed
Refactor logout
1 parent 2e21c44 commit 8dd022f

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

config/blade-ui-kit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// 'html' => Components\Layouts\Html::class,
3333
'input' => Components\Forms\Inputs\Input::class,
3434
'label' => Components\Forms\Label::class,
35-
// 'logout' => Components\Buttons\Logout::class,
35+
'logout' => Components\Buttons\Logout::class,
3636
// 'mapbox' => Components\Maps\Mapbox::class,
3737
'markdown' => Components\Markdown\Markdown::class,
3838
'password' => Components\Forms\Inputs\Password::class,

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/views/layouts/_nav.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@
197197
@endcan
198198

199199
<li class="mb-4 lg:hover:bg-gray-100 lg:mb-0">
200-
<a href="{{ route('logout') }}" class="inline-block w-full lg:px-4 lg:py-3">
200+
<x-buk-logout class="inline-block w-full text-left lg:px-4 lg:py-3">
201201
Sign out
202-
</a>
202+
</x-buk-logout>
203203
</li>
204204
</ul>
205205
</div>

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// Sessions
4040
Route::get('login', [LoginController::class, 'showLoginForm'])->name('login');
4141
Route::post('login', [LoginController::class, 'login'])->name('login.post');
42-
Route::get('logout', [LoginController::class, 'logout'])->name('logout');
42+
Route::post('logout', [LoginController::class, 'logout'])->name('logout');
4343

4444
// Registration
4545
Route::get('register', [RegisterController::class, 'showRegistrationForm'])->name('register');

tests/Feature/AuthTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126

127127
assertLoggedIn();
128128

129-
$this->visit('/logout')
129+
$this->visit('/')
130+
->press('Sign out')
130131
->seePageIs('/');
131132

132133
assertLoggedOut();
@@ -153,7 +154,7 @@
153154
->type('QFq^$cz#P@MZa5z7', 'password_confirmation')
154155
->press('Reset Password')
155156
->seePageIs('/user/johndoe')
156-
->visit('/logout')
157+
->press('Sign out')
157158
->visit('/login')
158159
->type('johndoe', 'username')
159160
->type('QFq^$cz#P@MZa5z7', 'password')

tests/Feature/HomeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
$this->visit('/')
1717
->seeLink('Login')
1818
->seeLink('Register')
19-
->dontSeeLink('Sign out');
19+
->dontSee('Sign out');
2020
});
2121

2222
test('users can see a logout button when logged in', function () {
2323
$this->login();
2424

2525
$this->visit('/')
26-
->seeLink('Sign out')
26+
->see('Sign out')
2727
->dontSeeLink('Login')
2828
->dontSeeLink('Register')
2929
->seeLink('Profile', '/user');

0 commit comments

Comments
 (0)