Skip to content

Commit

Permalink
add logout to 2fa pages
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjude committed Sep 6, 2024
1 parent cf0359a commit 71c4caa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions resources/views/components/logout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="flex justify-center w-full">
<form method="POST" action="{{ filament()->getCurrentPanel()->getLogoutUrl() }}">
<x-filament::link tag="button" type="submit" weight="semibold">
Logout
</x-filament::link>
</form>
</div>
6 changes: 4 additions & 2 deletions resources/views/pages/challenge.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
{{ $this->form }}

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>

<x-filament-two-factor-authentication::logout />

</x-filament-panels::page.simple>
3 changes: 3 additions & 0 deletions resources/views/pages/recovery.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>

<x-filament-two-factor-authentication::logout />

</x-filament-panels::page.simple>
2 changes: 1 addition & 1 deletion src/EnforceTwoFactorSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function handle(Request $request, Closure $next): mixed
{
$user = filament()->auth()->user();

if ($request->is('/logout/*') || $request->is('/profile/*')) {
if ($request->is('*/logout') || $request->is('*/profile')) {
return $next($request);
}

Expand Down

0 comments on commit 71c4caa

Please sign in to comment.