mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Force app
panel for EditProfile
(#1162)
* Force `app` panel for `EditProfile` * Force `app` panel for `OAuthController` * Use translation in `AdminPanelProvider` Co-authored-by: Boy132 <Boy132@users.noreply.github.com> --------- Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
parent
3310746107
commit
9a258efe53
@ -261,7 +261,7 @@ class EditProfile extends BaseEditProfile
|
||||
Action::make('Create')
|
||||
->label(trans('filament-actions::create.single.modal.actions.create.label'))
|
||||
->disabled(fn (Get $get) => $get('description') === null)
|
||||
->successRedirectUrl(self::getUrl(['tab' => '-api-keys-tab']))
|
||||
->successRedirectUrl(self::getUrl(['tab' => '-api-keys-tab'], panel: 'app'))
|
||||
->action(function (Get $get, Action $action, User $user) {
|
||||
$token = $user->createToken(
|
||||
$get('description'),
|
||||
@ -345,7 +345,7 @@ class EditProfile extends BaseEditProfile
|
||||
$tokens = $this->toggleTwoFactorService->handle($record, $token, true);
|
||||
cache()->put("users.$record->id.2fa.tokens", implode("\n", $tokens), now()->addSeconds(15));
|
||||
|
||||
$this->redirectRoute('filament.admin.auth.profile', ['tab' => '-2fa-tab']);
|
||||
$this->redirect(self::getUrl(['tab' => '-2fa-tab'], panel: 'app'));
|
||||
}
|
||||
|
||||
if ($token = $data['2fa-disable-code'] ?? null) {
|
||||
|
@ -53,7 +53,7 @@ class OAuthController extends Controller
|
||||
|
||||
$this->updateService->handle($request->user(), ['oauth' => $oauth]);
|
||||
|
||||
return redirect(EditProfile::getUrl(['tab' => '-oauth-tab']));
|
||||
return redirect(EditProfile::getUrl(['tab' => '-oauth-tab'], panel: 'app'));
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -38,9 +38,9 @@ class AdminPanelProvider extends PanelProvider
|
||||
->favicon(config('app.favicon', '/pelican.ico'))
|
||||
->topNavigation(config('panel.filament.top-navigation', true))
|
||||
->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
|
||||
->profile(EditProfile::class, false)
|
||||
->login(Login::class)
|
||||
->userMenuItems([
|
||||
'profile' => MenuItem::make()->label(trans('filament-panels::pages/auth/edit-profile.label'))->url(fn () => EditProfile::getUrl(panel: 'app')),
|
||||
MenuItem::make()
|
||||
->label(trans('profile.exit_admin'))
|
||||
->url('/')
|
||||
|
Loading…
x
Reference in New Issue
Block a user