Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Sep 12, 2024
1 parent f9ea958 commit fe4b320
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion resources/views/two-factor.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<x-filament-panels::page>

<div class="space-y-10 divide-y divide-gray-900/10 ">
<div class="grid grid-cols-1 gap-x-8 gap-y-8 pt-10 md:grid-cols-3">
<div class="pr-4 sm:px-0">
<h2 class="text-base font-semibold leading-7 dark:bg-white">
{{ __('Secure your account') }}
{{ __('Secure your account') }} sdfsadfsa
</h2>

@if (!$showingRecoveryCodes && $user->two_factor_confirmed_at)
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Middleware/ForceTwoFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public function handle(Request $request, Closure $next): mixed
if ($currentPanel) {
return redirect()->to(route('filament.' . $currentPanel->getId() . '.pages.two-factor', [
'tenant' => Filament::getTenant(),
]));
]))->with('two_factor_redirect_message', __('Your administrator requires you to enable two-factor authentication.'));
}
}

return $next($request);
}
}
}
10 changes: 9 additions & 1 deletion src/Pages/TwoFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public function getTitle(): string | Htmlable

public function mount(): void
{
if (session('two_factor_redirect_message')) {
Notification::make()
->title(session('two_factor_redirect_message'))
->danger()
->persistent()
->send();
}

$this->twoFactorOptionsCount = config('filament-two-factor-auth.options') ? count(config('filament-two-factor-auth.options')) : 0;

$this->user = Auth::user();
Expand Down Expand Up @@ -272,4 +280,4 @@ public function regenerateRecoveryCodes(GenerateNewRecoveryCodes $generate): voi

$this->showingRecoveryCodes = true;
}
}
}

0 comments on commit fe4b320

Please sign in to comment.