Getting an HttpException, when trying to authentication horizon dashboard based on user permission but getting an HttpException with no message.
So, the code is something like this where we have an isAdmin() method in the User model.
Horizon::auth(function ($request) {
return $request->user() && $request->user()->isAdmin();
});
also
Horizon::auth(function ($request) {
return Auth::check() && Auth::user()->isAdmin();
});
even explicitly returning false also throw this exception.
yes a 404 is sent so that people won't be able to guess if you're using horizon or not.
Wouldn't it make more sense to actually call a 403 view or similar?
Dropping a huge stackdump on /horizon for unauthenticated users pretty much enables you to guess that horizon is used.
I'm agree with @f0o
Most helpful comment
Wouldn't it make more sense to actually call a 403 view or similar?
Dropping a huge stackdump on /horizon for unauthenticated users pretty much enables you to guess that horizon is used.