Skip to content

Commit f5d8bbf

Browse files
authored
Merge pull request #80 from stephenjude/main
Chore: Middleware Usage & Translation Fixes
2 parents 72bafc4 + fd60e01 commit f5d8bbf

File tree

6 files changed

+31
-23
lines changed

6 files changed

+31
-23
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to `filament-two-factor-authentication` will be documented in this file.
44

5+
## 3.0.3 - 2025-08-17
6+
7+
### What's Changed
8+
9+
* Add constructor property promotion support for events by @stephenjude in https://github.com/stephenjude/filament-two-factor-authentication/pull/78
10+
* Improvements: Switch 2FA challenge from hash validation to decrypt validation and Cleanup translation usage. by @stephenjude in https://github.com/stephenjude/filament-two-factor-authentication/pull/79
11+
12+
**Full Changelog**: https://github.com/stephenjude/filament-two-factor-authentication/compare/3.0.2...3.0.3
13+
514
## 3.0.2 - 2025-08-17
615

716
### What's Changed

resources/lang/en/components.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
'login' => 'Login with Passkey',
4242
'tootip' => 'Use Face ID, fingerprint, or PIN',
4343
'notice' => [
44-
'header' => 'Passkeys are a passwordless login method using your device’s biometric authentication (fingerprint, Face ID, Windows Hello, etc.). Instead of typing a password, you approve login on your trusted device.',
44+
'header' => 'Passkeys are a passwordless login method using your device’s biometric authentication. Instead of typing a password, you approve login on your trusted device.',
4545
],
4646
],
4747
];
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<div class="flex justify-center w-full">
2-
<form method="POST" action="{{ filament()->getCurrentOrDefaultPanel()->getLogoutUrl() }}">
3-
@csrf
4-
<x-filament::link style="align-center" tag="button" type="submit" weight="semibold">
5-
{{__('filament-two-factor-authentication::components.logout.button')}}
6-
</x-filament::link>
7-
</form>
8-
</div>
1+
<form
2+
style="display: flex; justify-content: center; align-items: center;"
3+
method="POST"
4+
action="{{ filament()->getCurrentOrDefaultPanel()->getLogoutUrl() }}">
5+
@csrf
6+
<x-filament::link tag="button" type="submit" weight="semibold">
7+
{{__('filament-two-factor-authentication::components.logout.button')}}
8+
</x-filament::link>
9+
</form>

resources/views/pages/challenge.blade.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@
1313
/>
1414
</form>
1515

16-
<x-filament-two-factor-authentication::logout />
17-
1816
</x-filament-panels::page.simple>

resources/views/pages/recovery.blade.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,4 @@
1212
:full-width="$this->hasFullWidthFormActions()"
1313
/>
1414
</form>
15-
16-
<x-filament-two-factor-authentication::logout />
17-
1815
</x-filament-panels::page.simple>

src/TwoFactorAuthenticationPlugin.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Stephenjude\FilamentTwoFactorAuthentication;
44

55
use Closure;
6+
use Filament\Actions\Action;
67
use Filament\Contracts\Plugin;
7-
use Filament\Navigation\MenuItem;
88
use Filament\Panel;
99
use Filament\Support\Concerns\EvaluatesClosures;
1010
use Filament\View\PanelsRenderHook;
@@ -75,16 +75,19 @@ public function register(Panel $panel): void
7575
->routes(fn () => [
7676
Route::get('/two-factor-challenge', Challenge::class)->name('two-factor.challenge'),
7777
Route::get('/two-factor-recovery', Recovery::class)->name('two-factor.recovery'),
78-
Route::get('/two-factor-setup', Setup::class)->name('two-factor.setup'),
79-
Route::prefix('passkeys')->group(function () {
80-
Route::get('authentication-options', GeneratePasskeyAuthenticationOptionsController::class)
81-
->name('passkeys.authentication_options');
82-
Route::post('authenticate', AuthenticateUsingPasskeyController::class)
83-
->name('passkeys.login');
84-
}),
78+
Route::get('/two-factor-setup', Setup::class)
79+
->name('two-factor.setup')
80+
->middleware($this->getTwoFactorChallengeMiddleware()),
81+
Route::prefix('passkeys')
82+
->group(function () {
83+
Route::get('authentication-options', GeneratePasskeyAuthenticationOptionsController::class)
84+
->name('passkeys.authentication_options');
85+
Route::post('authenticate', AuthenticateUsingPasskeyController::class)
86+
->name('passkeys.login');
87+
}),
8588
])
8689
->userMenuItems([
87-
MenuItem::make()
90+
Action::make('two-factor-settings')
8891
->visible($this->hasTwoFactorMenuItem())
8992
->url(fn (): string => $panel->route('two-factor.setup'))
9093
->label(fn () => __($this->getTwoFactorMenuItemLabel()))

0 commit comments

Comments
 (0)