Logout
This commit is contained in:
1 parent
4e774e4fe1
commit
c09da27dea
3 files changed
+13
-4
No files matched your search
@@ -4,6 +4,7 @@ namespace AlexanderGabriel\FilamentOauth2;
|
||||
|
||||
use AlexanderGabriel\FilamentOauth2\Facades\FilamentOauth2;
|
||||
use Filament\Contracts\Plugin;
|
||||
use Filament\Navigation\MenuItem;
|
||||
use Filament\Panel;
|
||||
|
||||
class FilamentOauth2Plugin implements Plugin
|
||||
@@ -15,7 +16,15 @@ class FilamentOauth2Plugin implements Plugin
|
||||
|
||||
public function register(Panel $panel): void
|
||||
{
|
||||
$panel->login(FilamentOauth2::getLoginRouteAction());
|
||||
$panel
|
||||
->login(FilamentOauth2::getLoginRouteAction())
|
||||
->userMenuItems([
|
||||
'logout' => MenuItem::make()->url(function () {
|
||||
$panel = filament()->getCurrentPanel();
|
||||
return '/'.$panel->getPath().'/'.$this->getId().'/handleLogout';
|
||||
}),
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function boot(Panel $panel): void
|
||||
|
||||
Reference in new issue
Block a user