Skip to content

Commit

Permalink
fix password reset page by adding middleware, and make the rediret af…
Browse files Browse the repository at this point in the history
…ter login configurable
  • Loading branch information
PaulMcRoarSoftware committed Dec 20, 2023
1 parent c8a4a79 commit 94ea443
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/filament-invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
// config for Concept7/FilamentInvite
return [
'expiration_time_in_hours' => '24',
'after_login_redirect_route' => 'filament.admin.pages.dashboard',
];
6 changes: 6 additions & 0 deletions src/FilamentInviteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Livewire\Livewire;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Session\Middleware\StartSession;

class FilamentInviteServiceProvider extends PackageServiceProvider
{
Expand Down Expand Up @@ -69,6 +71,10 @@ public function panel(Panel $panel): Panel
return $panel
->id('invite')
->path('invite')
->middleware([
EncryptCookies::class,
StartSession::class,
])
->pages([
Accept::class,
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Livewire/Accept.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function submit()
return route('filament.auth.login');
}

return redirect()->intended(route('filament.admin.pages.dashboard'));
return redirect()->intended(route(config('filament-invite.after_login_redirect_route')));

}

Expand Down

0 comments on commit 94ea443

Please sign in to comment.