-
Notifications
You must be signed in to change notification settings - Fork 59
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
Impersonate stopped working after Laravel update? #10
Comments
What error do you get in both the browser and error log when you try?
- Mark
… On Mar 29, 2022, at 6:29 PM, seabasss ***@***.***> wrote:
Impersonate stopped working after I updated Laravel. I was on Laravel 9.3.1 and it worked and after updating to 9.6.0 I just get logged out when I click on the impersonate button. Any ideas why? Impersonate, Filament and Jetstream are all on latest versions.
Thank you!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
No error. In Filament I go to users and then click the impersonate button and I just get logged out and end up on the Jetstream log in page. It used to work fine before I updated Laravel. It seems like the issues started around Laravel v9.5.0. See possibly related issues: |
Exact same thing happens in a fresh app. Steps to reproduce: Install Laravel: Run:
Install Filament: Add ListUsers.php: <?php
namespace App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
protected static string $resource = UserResource::class;
} Add UserResource.php: <?php
namespace App\Filament\Resources;
use Filament\Forms;
use App\Models\User;
use Filament\Tables;
use Filament\Resources\Form;
use Filament\Resources\Table;
use Filament\Resources\Resource;
use STS\FilamentImpersonate\Impersonate;
use App\Filament\Resources\UserResource\Pages;
class UserResource extends Resource
{
protected static ?string $model = User::class;
protected static ?string $navigationIcon = 'heroicon-o-users';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')->required(),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name'),
])
->prependActions([
Impersonate::make('impersonate'),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
} Log in to Filament as one of the users and click on Users in the menu and then the impersonate symbol. |
Is this still an issue? |
yes! |
impersonate suddenly stopped working for me as well |
Fresh install - also not working after following all directions to a T. |
Any news on this? I fixed it by adding |
Is everyone using Sanctum in this thread? I've been utterly unable to reproduce the issue myself. Fresh Laravel 10 app, fresh Filament install, and then installed this package I'm not seeing any issue with this package and latest versions of Laravel, at all. Now there might be something we need to look at with Sanctum specifically, not sure. A few in this thread mention Sanctum. I'm not terribly familiar with that. Can someone provide more specific instructions on how to reproduce this, with a fresh Laravel app, using Sanctum? If anyone else is still having problems with latest Laravel, please try to reproduce in a fresh app and provide details. If I can't reproduce, I can't see what the issue is and how to fix. |
Alright, after a bunch of trial & error today I think I was able to reproduce what y'all are seeing with Sanctum. And Ultimately the issue needs to be resolved in the underlying |
Impersonate stopped working after I updated Laravel. I was on Laravel 9.3.1 and it worked and after updating to 9.6.0 I just get logged out when I click on the impersonate button. Any ideas why? Impersonate, Filament and Jetstream are all on latest versions.
I found two things that seems to "fix" this. One is removing this line from
App\Http\Kernel.php
...\Laravel\Jetstream\Http\Middleware\AuthenticateSession::class,
and the other is changingRoute::middleware(['auth:sanctum', 'verified'])
toRoute::middleware(['auth:web', 'verified'])
in my routes file. Does anyone know the implications of doing any of those options?Thank you!
The text was updated successfully, but these errors were encountered: