-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Closed
Copy link
Description
- Laravel Version: 9.7
- Nova Version: 4.1.0
- PHP Version: 8.1
- Database Driver & Version: MySQL
- Operating System and Version: WSL2 Ubuntu
- Browser type and version: Chrome Latest Stable
- Reproduction Repository:
Jetstream Livewire: https://github.com/RhysLees/novatest
Jetstream Inertia: https://github.com/RhysLees/novatestinertia
Description:
Impersonating a user only works on routes for Jetstream when you log in via the Nova Login route. logging in via jetstreams auth route then impersonating causes you to be logged out of the session.
Detailed steps to reproduce the issue on a fresh Nova installation:
- clone reproduction repo
- migrate DB (migrating also creates 2 users and an admin)
- login with email
admin@admin.co.ukpassadmin123via jetstream login/login - goto nova user page and impersonate user 1 or user 2, this will redirect you to
/ - click dashboard in the top right and you will be logged out
- now login via nova login route
/nova/login - repeat steps 4 and 5 and you will not be logged out and impersonation works as intended.
The only thing I how found that fixed this is to remove config('jetstream.auth_session'), from the middleware group
Not working:
Route::middleware([
'auth:sanctum',
config('jetstream.auth_session'),
'verified'
])->group(function () {
Route::get('/dashboard', function () {
return view('dashboard');
})->name('dashboard');
});Working:
Route::middleware([
'auth:sanctum',
'verified'
])->group(function () {
Route::get('/dashboard', function () {
return view('dashboard');
})->name('dashboard');
});Removing this makes the application less secure so I'm not sure if there is a better solution to this.
jjjrmy
Metadata
Metadata
Assignees
Labels
No labels


