Do you have an authenticated user? IIRC you need to be authenticated as well as passing the gate condition
Nov 20, 2018
4
Level 7
can not get Horizon dashboard authorization work
Horizon has new Dashboard Authorization using Gate. I set env to production, and return true inside gate. I get 403 when accessing Horizon, which I don't understand, the gate should allow me to get in.
/**
* Register the Horizon gate.
*
* This gate determines who can access Horizon in non-local environments.
*
* @return void
*/
protected function gate()
{
Gate::define('viewHorizon', function ($user) {
return true; // still get 403
});
}
what do I miss?
Level 51
Looking through the code by default you web middleware will be applied bear this in mind when looking at why your getting a 403
https://github.com/laravel/horizon/blob/384c84512cdf929886343c2e498f8dc4180d8728/config/horizon.php
Please or to participate in this conversation.