-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[5.x] Throws
Laravel\Horizon\Exceptions\ForbiddenException
on unaut…
…horized access (#1308) * Allow overriding the status code for unauthorized requests via config * Update tests * Use custom unauthorized exception instead of config value * Remove unused imports * Use custom exception * Use original error code and rename exception * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * formatting --------- Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: Joel Butcher <> Co-authored-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
0c3d961
commit 2fc2ba7
Showing
3 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Laravel\Horizon\Exceptions; | ||
|
||
use Symfony\Component\HttpKernel\Exception\HttpException; | ||
|
||
class ForbiddenException extends HttpException | ||
{ | ||
/** | ||
* Create a new exception instance. | ||
* | ||
* @return static | ||
*/ | ||
public static function make() | ||
{ | ||
return new static(403); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters