Skip to content

Commit

Permalink
Fix up authorization plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Feb 25, 2025
1 parent fbf00b4 commit 9eafb63
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ class ForbiddenRedirectHandler extends RedirectHandler {
* Default config:
*
* - `exceptions` - A list of exception classes.
* - `url` - Url to redirect to.
* - `queryParam` - Query parameter name for the target url.
* - `url` - URL to redirect to.
* - `queryParam` - Query parameter name for the target URL.
* - `statusCode` - Redirection status code.
* - `unauthorizedMessage` - Error message. Set to false to disable.
*
* @var array<string, mixed>
*/
Expand All @@ -43,7 +44,7 @@ class ForbiddenRedirectHandler extends RedirectHandler {
public function handle(Exception $exception, ServerRequestInterface $request, array $options = []): ResponseInterface {
$response = parent::handle($exception, $request, $options);

$message = $options['unauthorizedMessage'] ?? __('You are not authorized to access that location');
$message = $options['unauthorizedMessage'] ?? __('You are not authorized to access that location.');
if ($message) {
/** @var \Cake\Http\ServerRequest $request */
$request->getFlash()->error($message);
Expand Down

0 comments on commit 9eafb63

Please sign in to comment.