markus.heb's avatar

Horizon auto redirect if unauthenticated

When I'm unauthenticated and try to access Laravel Horizon, I always get an 403 error from the Application.

Is it possible to configure Horizon so that I get redirected to the Login Page and only show the 403 error if the authenticated user is not allowed to access the Horizon Dashboard?

0 likes
2 replies
markus.heb's avatar

Thank you, the middleware hint was the key to success :)

As soon as I used this in config/horizon.php

'middleware' => ['web', 'auth']

it worked.

Please or to participate in this conversation.