Skip to content

Impersonating a user only works via Nova 4 Login route when using with Jetstream #3989

Locked Answered by crynobone
RhysLees asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't tested Jetstream with Inertia but this can be fixed by adding the following routes/web.php:

Route::middleware([
    'auth:web,sanctum',
     config('jetstream.auth_session'),
    'verified'
])->group(function () {
    Route::get('/dashboard', function () {
        return view('dashboard');
    })->name('dashboard');
});

and then update config/nova.php and add auth.session:

    'middleware' => [
        'web',
        'auth.session',
        HandleInertiaRequests::class,
        DispatchServingNovaEvent::class,
        BootTools::class,
    ],

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Mitcal
Comment options

Answer selected by RhysLees
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@crynobone
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #3894 on April 14, 2022 03:24.