File tree Expand file tree Collapse file tree 1 file changed +28
-4
lines changed
Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,12 @@ class Auth extends BaseConfig
6565 * to apply any logic you may need.
6666 */
6767 public array $ redirects = [
68- 'register ' => '/ ' ,
69- 'login ' => '/ ' ,
70- 'logout ' => 'login ' ,
71- 'force_reset ' => '/ ' ,
68+ 'register ' => '/ ' ,
69+ 'login ' => '/ ' ,
70+ 'logout ' => 'login ' ,
71+ 'force_reset ' => '/ ' ,
72+ 'after_permission_denied ' => '/ ' ,
73+ 'after_group_denied ' => '/ ' ,
7274 ];
7375
7476 /**
@@ -475,6 +477,28 @@ public function forcePasswordResetRedirect(): string
475477 return $ this ->getUrl ($ url );
476478 }
477479
480+ /**
481+ * Returns the URL the user should be redirected to
482+ * if permission denied.
483+ */
484+ public function afterPermissionDeniedRedirect (): string
485+ {
486+ $ url = setting ('Auth.redirects ' )['after_permission_denied ' ];
487+
488+ return $ this ->getUrl ($ url );
489+ }
490+
491+ /**
492+ * Returns the URL the user should be redirected to
493+ * if group denied.
494+ */
495+ public function afterGroupDeniedRedirect (): string
496+ {
497+ $ url = setting ('Auth.redirects ' )['after_group_denied ' ];
498+
499+ return $ this ->getUrl ($ url );
500+ }
501+
478502 /**
479503 * Accepts a string which can be an absolute URL or
480504 * a named route or just a URI path, and returns the
You can’t perform that action at this time.
0 commit comments