Skip to content

Commit e9b6a3c

Browse files
committed
feedback
1 parent 4122cc2 commit e9b6a3c

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

docs/user-authentication.txt

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ manage user authentication, as shown in the following code:
100100
Customize User Authentication
101101
-----------------------------
102102

103-
In this section, you can learn how to use the following features to
104-
customize your MongoDB user authentication process:
103+
You can customize your authentication files to align with your application's
104+
needs and enable additional authentication features.
105+
106+
This section describes how to use the following features to customize the MongoDB user
107+
authentication process:
105108

106109
- :ref:`laravel-user-auth-sanctum`
107110
- :ref:`laravel-user-auth-reminders`
@@ -111,45 +114,40 @@ customize your MongoDB user authentication process:
111114
Laravel Sanctum
112115
~~~~~~~~~~~~~~~
113116

114-
You can install the Laravel Sanctum package to provide API tokens to users
115-
and authenticate single-page applications. To manage API tokens, Sanctum stores
116-
each token in a database table and authenticates incoming HTTP requests through
117-
the ``Authorization`` header. To authenticate single-page applications, Sanctum
118-
uses Laravel's cookie-based authentication services.
117+
Laravel Sanctum is an authentication package that can manage API requests and
118+
single-page application authentication. To manage API requests, Sanctum issues
119+
API tokens that are stored in a database table and authenticates incoming HTTP
120+
requests by using the ``Authorization`` header. To authenticate single-page applications,
121+
Sanctum uses Laravel's cookie-based authentication services.
119122

120-
Run the following commands from your project root to install Laravel Sanctum,
121-
then publish and run its migration files:
123+
You can install Laravel Sanctum to manage your application's authentication
124+
process. Run the following commands from your project root to install Laravel
125+
Sanctum and publish its migration file:
122126

123127
.. code-block:: bash
124128

125129
composer require laravel/sanctum
126130
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
127-
php artisan migrate
128-
129-
.. tip::
130-
131-
To learn more about installing and configuring Laravel Sanctum, see the
132-
`Installation <https://laravel.com/docs/{+laravel-docs-version+}/sanctum#installation>`__
133-
section of the Laravel Sanctum guide.
134-
135-
To use Laravel Sanctum with {+odm-short+}, you must modify the ``PersonalAccessToken``
136-
model provided by Sanctum.
137-
138-
Example
139-
```````
140131

141-
The following code extends the ``PersonalAccessToken`` model provided by Sanctum
132+
Next, modify the ``PersonalAccessToken`` model provided by Laravel Sanctum to use
133+
Sanctum with {+odm-short+}. The following code extends the ``PersonalAccessToken`` model
142134
to enable MongoDB:
143135

144136
.. literalinclude:: /includes/auth/PersonalAccessToken.php
145137
:language: php
146138
:dedent:
147139

148-
After modifying the ``PersonalAccessToken`` model, instruct Sanctum to use the custom
149-
model by calling the ``usePersonalAccessTokenModel()`` method in one of your application's
150-
service providers. To learn more, see the `Overriding Default Models
140+
Then, run the following command to modify the database schema to handle API tokens:
141+
142+
.. code-block:: bash
143+
144+
php artisan migrate
145+
146+
You can now instruct Sanctum to use the custom ``PersonalAccessToken`` model by calling
147+
the ``usePersonalAccessTokenModel()`` method in one of your application's
148+
service providers. To learn more, see `Overriding Default Models
151149
<https://laravel.com/docs/{+laravel-docs-version+}/sanctum#overriding-default-models>`__
152-
section of the Laravel Sanctum guide.
150+
in the Laravel Sanctum guide.
153151

154152
.. _laravel-user-auth-reminders:
155153

0 commit comments

Comments
 (0)