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
-[Change Available Groups](#change-available-groups)
18
18
-[Set the Default Group](#set-the-default-group)
@@ -42,29 +42,29 @@ public array $redirects = [
42
42
43
43
NOTE: This redirect happens after the specified action is complete. In the case of register or login, it might not happen immediately. For example, if you have any Auth Actions specified, they will be redirected when those actions are completed successfully. If no Auth Actions are specified, they will be redirected immediately after registration or login.
44
44
45
-
### Customize login redirect
45
+
### Customize register redirect
46
46
47
-
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.
47
+
You can customize where a user is redirected to after registration in the `registerRedirect` method of the `Auth` config file.
48
48
49
49
```php
50
-
public function loginRedirect(): string
50
+
public function registerRedirect(): string
51
51
{
52
-
$url = auth()->user()->inGroup('admin')
53
-
? '/admin'
54
-
: setting('Auth.redirects')['login'];
52
+
$url = setting('Auth.redirects')['register'];
55
53
56
54
return $this->getUrl($url);
57
55
}
58
56
```
59
57
60
-
### Customize register redirect
58
+
### Customize login redirect
61
59
62
-
You can customize where a user is redirected to after registration in the `registerRedirect` method of the `Auth` config file.
60
+
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.
63
61
64
62
```php
65
-
public function registerRedirect(): string
63
+
public function loginRedirect(): string
66
64
{
67
-
$url = setting('Auth.redirects')['register'];
65
+
$url = auth()->user()->inGroup('admin')
66
+
? '/admin'
67
+
: setting('Auth.redirects')['login'];
68
68
69
69
return $this->getUrl($url);
70
70
}
@@ -104,17 +104,6 @@ By default, Access Tokens can be used for 1 year since the last use. This can be
104
104
public int $unusedTokenLifetime = YEAR;
105
105
```
106
106
107
-
### Enable Two-Factor Authentication
108
-
109
-
Turned off by default, Shield's Email-based 2FA can be enabled by specifying the class to use in the `Auth` config file.
By default, once a user registers they have an active account that can be used. You can enable Shield's built-in, email-based activation flow within the `Auth` config file.
@@ -126,8 +115,16 @@ public array $actions = [
126
115
];
127
116
```
128
117
118
+
### Enable Two-Factor Authentication
129
119
120
+
Turned off by default, Shield's Email-based 2FA can be enabled by specifying the class to use in the `Auth` config file.
Permissions can also be assigned directly to a user, regardless of what groups they belong to. This is done programatically on the `User` Entity.
@@ -256,8 +252,6 @@ if ($user->inGroup('admin', 'beta')) {
256
252
}
257
253
```
258
254
259
-
260
-
261
255
## Managing Users
262
256
263
257
Shield uses a more complex user setup than many other systems, separating [User Identities](concepts.md#identities) from the user accounts themselves. This quick overview should help you feel more confident when working with users on a day-to-day basis.
0 commit comments