Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 403 Forbidden when clicked from table actions #83

Open
momostafa opened this issue Jun 12, 2024 · 2 comments
Open

Error 403 Forbidden when clicked from table actions #83

momostafa opened this issue Jun 12, 2024 · 2 comments

Comments

@momostafa
Copy link

momostafa commented Jun 12, 2024

Hi,

When i click Impersonate from table actions I get
Error 403 Forbidden I assume because the url stays the same mysite.test/admin/users
When I click Impersonate from Edit view everything works normally

Laravel: 11.10.0
PHP 8.2.19
Filament: v3.2.86

Thanks for your help and support

use STS\FilamentImpersonate\Tables\Actions\Impersonate;

class UserResource extends Resource

            ->actions([
                Impersonate::make(),
                EditAction::make(),
                ActionGroup::make([
                    ViewAction::make(),
                    EditAction::make(),
                    DeleteAction::make(),
                    Impersonate::make(),
                ]),
            ])

config file

<?php
return [
    // This is the guard used when logging in as the impersonated user.
    'guard' => env('FILAMENT_IMPERSONATE_GUARD', 'web'),
    
    // After impersonating this is where we'll redirect you to.
    'redirect_to' => env('FILAMENT_IMPERSONATE_REDIRECT', '/admin'),

    // We wire up a route for the "leave" button. You can change the middleware stack here if needed.
    'leave_middleware' => env('FILAMENT_IMPERSONATE_LEAVE_MIDDLEWARE', 'web'),

    'banner' => [
        // Available hooks: https://filamentphp.com/docs/3.x/support/render-hooks#available-render-hooks
        'render_hook' => env('FILAMENT_IMPERSONATE_BANNER_RENDER_HOOK', 'panels::body.start'),
    
        // Currently supports 'dark', 'light' and 'auto'.
        'style' => env('FILAMENT_IMPERSONATE_BANNER_STYLE', 'dark'),

        // Turn this off if you want `absolute` positioning, so the banner scrolls out of view
        'fixed' => env('FILAMENT_IMPERSONATE_BANNER_FIXED', true),

        // Currently supports 'top' and 'bottom'.
        'position' => env('FILAMENT_IMPERSONATE_BANNER_POSITION', 'top'),

        'styles' => [
            'light' => [
                'text' => '#1f2937',
                'background' => '#f3f4f6',
                'border' => '#e8eaec',
            ],
            'dark' => [
                'text' => '#f3f4f6',
                'background' => '#1f2937',
                'border' => '#374151',
            ],
        ]
    ],
];
@user3470
Copy link

It's not redirecting after impersonating resulting in a Forbidden Error

@koppa53
Copy link

koppa53 commented Aug 10, 2024

I'm having the same issue anyone got a solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants