Skip to content

Commit b7a9e0c

Browse files
committed
docs: change section order
regiter -> login -> logout
1 parent e75a492 commit b7a9e0c

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

docs/quickstart.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ NOTE: The examples assume that you have run the setup script and that you have c
66

77
- [Quick Start Guide](#quick-start-guide)
88
- [Authentication Flow](#authentication-flow)
9-
- [Customize login redirect](#customize-login-redirect)
109
- [Customize register redirect](#customize-register-redirect)
10+
- [Customize login redirect](#customize-login-redirect)
1111
- [Customize logout redirect](#customize-logout-redirect)
1212
- [Customize Remember-me functionality](#customize-remember-me-functionality)
1313
- [Change Access Token Lifetime](#change-access-token-lifetime)
@@ -42,29 +42,29 @@ public array $redirects = [
4242

4343
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.
4444

45-
### Customize login redirect
45+
### Customize register redirect
4646

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.
4848

4949
```php
50-
public function loginRedirect(): string
50+
public function registerRedirect(): string
5151
{
52-
$url = auth()->user()->inGroup('admin')
53-
? '/admin'
54-
: setting('Auth.redirects')['login'];
52+
$url = setting('Auth.redirects')['register'];
5553

5654
return $this->getUrl($url);
5755
}
5856
```
5957

60-
### Customize register redirect
58+
### Customize login redirect
6159

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.
6361

6462
```php
65-
public function registerRedirect(): string
63+
public function loginRedirect(): string
6664
{
67-
$url = setting('Auth.redirects')['register'];
65+
$url = auth()->user()->inGroup('admin')
66+
? '/admin'
67+
: setting('Auth.redirects')['login'];
6868

6969
return $this->getUrl($url);
7070
}

0 commit comments

Comments
 (0)