Skip to content

Commit

Permalink
fix: force fortify config when package is registered to support filam…
Browse files Browse the repository at this point in the history
…ent panels on root path
  • Loading branch information
markvaneijk committed Oct 30, 2024
1 parent c815543 commit ac5d67d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/TwoFactorAuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ public function configurePackage(Package $package): void
}
}

public function packageRegistered(): void {}
public function packageRegistered(): void
{
$this->forceFortifyConfig();
}

public function packageBooted(): void
{
Expand Down Expand Up @@ -145,8 +148,6 @@ public function packageBooted(): void
// Testing
Testable::mixin(new TestsTwoFactorAuth);

$this->forceFortifyConfig();

$this->registerContractsAndComponents();

$this->defineRateLimiters();
Expand All @@ -170,7 +171,7 @@ public function packageBooted(): void
* This route name is used multiple places in filament.
*/
Route::prefix(config('filament.path'))->group(function () {
Route::get('/filament-login', fn () => Redirect::route('login'))
Route::get('/filament-login', fn() => Redirect::route('login'))
->name('auth.login');
});
});
Expand All @@ -180,6 +181,7 @@ protected function forceFortifyConfig(): void
{
config([
'filament.auth.pages.login' => config('filament-2fa.login'),
'fortify.prefix' => 'fortify',
'fortify.views' => true,
'fortify.home' => config('filament.home_url'),
'forms.dark_mode' => config('filament.dark_mode'),
Expand Down

0 comments on commit ac5d67d

Please sign in to comment.