states, and pulls data from the authenticated /api/v1/tenant/packages endpoint.
(resources/js/admin/pages/EventFormPage.tsx, resources/js/admin/api.ts)
- Harden tenant-admin auth flow: prevent PKCE state loss, scope out StrictMode double-processing, add SPA
routes for /event-admin/login and /event-admin/logout, and tighten token/session clearing semantics (resources/js/admin/auth/{context,tokens}.tsx, resources/js/admin/pages/{AuthCallbackPage,LogoutPage}.tsx,
resources/js/admin/router.tsx, routes/web.php)
55 lines
1.9 KiB
PHP
55 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\RefreshTokenResource\Pages;
|
|
|
|
use App\Filament\Resources\RefreshTokenResource;
|
|
use Filament\Actions;
|
|
use Filament\Forms;
|
|
use Filament\Resources\Pages\ViewRecord;
|
|
|
|
class ViewRefreshToken extends ViewRecord
|
|
{
|
|
protected static string $resource = RefreshTokenResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\Action::make('revoke')
|
|
->label(__('admin.refresh_tokens.actions.revoke'))
|
|
->icon('heroicon-o-no-symbol')
|
|
->color('danger')
|
|
->visible(fn (): bool => $this->record->isActive())
|
|
->form([
|
|
Forms\Components\Select::make('reason')
|
|
->label(__('admin.refresh_tokens.fields.revoked_reason'))
|
|
->options([
|
|
'manual' => __('admin.refresh_tokens.reasons.manual'),
|
|
'operator' => __('admin.refresh_tokens.reasons.operator'),
|
|
])
|
|
->default('manual')
|
|
->required(),
|
|
Forms\Components\Textarea::make('note')
|
|
->label(__('admin.refresh_tokens.fields.note'))
|
|
->rows(2)
|
|
->maxLength(255),
|
|
])
|
|
->requiresConfirmation()
|
|
->action(function (array $data): void {
|
|
$note = $data['note'] ?? null;
|
|
|
|
$this->record->revoke(
|
|
$data['reason'] ?? 'manual',
|
|
auth()->id(),
|
|
request(),
|
|
$note ? ['note' => $note] : []
|
|
);
|
|
|
|
$this->record->refresh();
|
|
|
|
$this->notify('success', __('admin.refresh_tokens.notifications.revoked'));
|
|
}),
|
|
];
|
|
}
|
|
}
|
|
|