You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, a successful login or register attempt will all redirect to `/`, while a logout action
33
-
will redirect to a [named route](https://codeigniter.com/user_guide/incoming/routing.html#using-named-routes"See routing docs")`login` or a *URI path*`/login`. You can change the default URLs used within the `Auth` config file:
33
+
will redirect to a [named route](https://codeigniter.com/user_guide/incoming/routing.html#using-named-routes"See routing docs")`login` or a *URI path*`/login`. You can change the default URLs used within the `app/Config/Auth.php` config file:
34
34
35
35
```php
36
36
public array $redirects = [
@@ -42,7 +42,7 @@ public array $redirects = [
42
42
43
43
### Customize Login Redirect
44
44
45
-
You can further customize where a user is redirected to on login with the `loginRedirect()` method of the `Auth` config file. This is handy if you want to redirect based on user group or other criteria.
45
+
You can further customize where a user is redirected to on login with the `loginRedirect()` method of the `app/Config/Auth.php` config file. This is handy if you want to redirect based on user group or other criteria.
46
46
47
47
```php
48
48
public function loginRedirect(): string
@@ -57,7 +57,7 @@ public function loginRedirect(): string
57
57
58
58
Oftentimes, you will want to have different redirects for different user groups. A simple example
59
59
might be that you want admins redirected to `/admin` while all other groups redirect to `/`.
60
-
The `Auth` config file also includes methods that you can add additional logic to in order to
60
+
The `app/Config/Auth.php` config file also includes methods that you can add additional logic to in order to
61
61
achieve this:
62
62
63
63
```php
@@ -75,7 +75,7 @@ public function loginRedirect(): string
75
75
76
76
### Customize Register Redirect
77
77
78
-
You can customize where a user is redirected to after registration in the `registerRedirect` method of the `Auth` config file.
78
+
You can customize where a user is redirected to after registration in the `registerRedirect` method of the `app/Config/Auth.php` config file.
79
79
80
80
```php
81
81
public function registerRedirect(): string
@@ -88,7 +88,7 @@ public function registerRedirect(): string
88
88
89
89
### Customize Logout Redirect
90
90
91
-
The logout redirect can also be overridden by the `logoutRedirect` method of the `Auth` config file. This will not be used as often as login and register, but you might find the need. For example, if you programatically logged a user out you might want to take them to a page that specifies why they were logged out. Otherwise, you might take them to the home page or even the login page.
91
+
The logout redirect can also be overridden by the `logoutRedirect` method of the `app/Config/Auth.php` config file. This will not be used as often as login and register, but you might find the need. For example, if you programatically logged a user out you might want to take them to a page that specifies why they were logged out. Otherwise, you might take them to the home page or even the login page.
0 commit comments