@@ -24,7 +24,7 @@ The default authenticator is also defined in the configuration file, and uses th
2424public $defaultAuthenticator = 'session';
2525```
2626
27- ### Auth Helper
27+ ## Auth Helper
2828
2929The auth functionality is designed to be used with the ` auth_helper ` that comes with Shield. This
3030helper method provides the ` auth() ` command which returns a convenient interface to the most frequently
@@ -42,33 +42,33 @@ user_id()
4242auth()->id()
4343```
4444
45- ### Authenticator Responses
45+ ## Authenticator Responses
4646
4747Many of the authenticator methods will return a ` CodeIgniter\Shield\Result ` class. This provides a consistent
4848way of checking the results and can have additional information return along with it. The class
4949has the following methods:
5050
51- #### isOK()
51+ ### isOK()
5252
5353Returns a boolean value stating whether the check was successful or not.
5454
55- #### reason()
55+ ### reason()
5656
5757Returns a message that can be displayed to the user when the check fails.
5858
59- #### extraInfo()
59+ ### extraInfo()
6060
6161Can return a custom bit of information. These will be detailed in the method descriptions below.
6262
6363
64- ### Session Authenticator
64+ ## Session Authenticator
6565
6666The Session authenticator stores the user's authentication within the user's session, and on a secure cookie
6767on their device. This is the standard password-based login used in most web sites. It supports a
6868secure remember me feature, and more. This can also be used to handle authentication for
6969single page applications (SPAs).
7070
71- #### attempt()
71+ ### attempt()
7272
7373When a user attempts to login with their email and password, you would call the ` attempt() ` method
7474on the auth class, passing in their credentials.
@@ -107,7 +107,7 @@ to set a secure remember-me cookie.
107107$loginAttempt = auth()->remember()->attempt($credentials);
108108```
109109
110- #### check()
110+ ### check()
111111
112112If you would like to check a user's credentials without logging them in, you can use the ` check() `
113113method.
@@ -127,7 +127,7 @@ if (! $validCreds->isOK()) {
127127
128128The Result instance returned contains the logged in user as ` extraInfo() ` .
129129
130- #### loggedIn()
130+ ### loggedIn()
131131
132132You can determine if a user is currently logged in with the aptly titled method, ` loggedIn() ` .
133133
@@ -137,7 +137,7 @@ if (auth()->loggedIn()) {
137137}
138138```
139139
140- #### logout()
140+ ### logout()
141141
142142You can call the ` logout() ` method to log the user out of the current session. This will destroy and
143143regenerate the current session, purge any remember-me tokens current for this user, and trigger a
@@ -147,18 +147,12 @@ regenerate the current session, purge any remember-me tokens current for this us
147147auth()->logout();
148148```
149149
150- #### forget()
150+ ### forget()
151151
152152The ` forget ` method will purge all remember-me tokens for the current user, making it so they
153153will not be remembered on the next visit to the site.
154154
155-
156-
157- ---
158-
159-
160-
161- ### Access Token Authenticator
155+ ## Access Token Authenticator
162156
163157The Access Token authenticator supports the use of revoke-able API tokens without using OAuth. These are commonly
164158used to provide third-party developers access to your API. These tokens typically have a very long
@@ -169,8 +163,7 @@ with their email/password. The application would create a new access token for t
169163name, like John's iPhone 12, and return it to the mobile application, where it is stored and used
170164in all future requests.
171165
172-
173- ## Access Token/API Authentication
166+ ### Access Token/API Authentication
174167
175168Using access tokens requires that you either use/extend ` CodeIgniter\Shield\Models\UserModel ` or
176169use the ` CodeIgniter\Shield\Authentication\Traits\HasAccessTokens ` on your own user model. This trait
@@ -291,13 +284,11 @@ These filters are already loaded for you by the registrar class located at `src/
291284
292285``` php
293286public $aliases = [
294- 'csrf' => CSRF::class,
295- 'toolbar' => DebugToolbar::class,
296- 'honeypot' => Honeypot::class,
297- 'session' => CodeIgniter\Shield\Filters\SessionAuth::class,
298- 'tokens' => CodeIgniter\Shield\Filters\TokenAuth::class,
299- 'chain' => CodeIgniter\Shield\Filters\ChainAuth::class,
287+ // ...
288+ 'session' => \CodeIgniter\Shield\Filters\SessionAuth::class,
289+ 'tokens' => \CodeIgniter\Shield\Filters\TokenAuth::class,
290+ 'chain' => \CodeIgniter\Shield\Filters\ChainAuth::class,
300291];
301292```
302293
303- These can be used in any of the normal validation config settings, or within the routes file.
294+ These can be used in any of the normal filter config settings, or within the routes file.
0 commit comments