File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/Middleware/UnauthorizedHandler Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ class ForbiddenRedirectHandler extends RedirectHandler {
1818 * Default config:
1919 *
2020 * - `exceptions` - A list of exception classes.
21- * - `url` - Url to redirect to.
22- * - `queryParam` - Query parameter name for the target url .
21+ * - `url` - URL to redirect to.
22+ * - `queryParam` - Query parameter name for the target URL .
2323 * - `statusCode` - Redirection status code.
24+ * - `unauthorizedMessage` - Error message. Set to false to disable.
2425 *
2526 * @var array<string, mixed>
2627 */
@@ -43,7 +44,7 @@ class ForbiddenRedirectHandler extends RedirectHandler {
4344 public function handle (Exception $ exception , ServerRequestInterface $ request , array $ options = []): ResponseInterface {
4445 $ response = parent ::handle ($ exception , $ request , $ options );
4546
46- $ message = $ options ['unauthorizedMessage ' ] ?? __ ('You are not authorized to access that location ' );
47+ $ message = $ options ['unauthorizedMessage ' ] ?? __ ('You are not authorized to access that location. ' );
4748 if ($ message ) {
4849 /** @var \Cake\Http\ServerRequest $request */
4950 $ request ->getFlash ()->error ($ message );
You can’t perform that action at this time.
0 commit comments