mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-26 12:31:25 +08:00
Fix typos, grammar and spelling mistakes in docs (#584)
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
|
||||
**FastAPI Users** defines a minimal User model for authentication purposes. It is structured like this:
|
||||
|
||||
* `id` (`UUID4`) – Unique identifier of the user. Default to a **UUID4**.
|
||||
* `id` (`UUID4`) – Unique identifier of the user. Defaults to a **UUID4**.
|
||||
* `email` (`str`) – Email of the user. Validated by [`email-validator`](https://github.com/JoshData/python-email-validator).
|
||||
* `is_active` (`bool`) – Whether or not the user is active. If not, login and forgot password requests will be denied. Default to `True`.
|
||||
* `is_verified` (`bool`) – Whether or not the user is verified. Optional but helpful with the [`verify` router](./routers/verify.md) logic. Default to `False`.
|
||||
* `is_superuser` (`bool`) – Whether or not the user is a superuser. Useful to implement administration logic. Default to `False`.
|
||||
* `is_active` (`bool`) – Whether or not the user is active. If not, login and forgot password requests will be denied. Defaults to `True`.
|
||||
* `is_verified` (`bool`) – Whether or not the user is verified. Optional but helpful with the [`verify` router](./routers/verify.md) logic. Defaults to `False`.
|
||||
* `is_superuser` (`bool`) – Whether or not the user is a superuser. Useful to implement administration logic. Defaults to `False`.
|
||||
|
||||
## Define your models
|
||||
|
||||
|
@ -56,7 +56,7 @@ class UserDB(User, models.BaseUserDB):
|
||||
|
||||
Notice that we inherit from the `BaseOAuthAccountMixin`, which adds a `List` of `BaseOAuthAccount` objects. This object is structured like this:
|
||||
|
||||
* `id` (`UUID4`) – Unique identifier of the OAuth account information. Default to a **UUID4**.
|
||||
* `id` (`UUID4`) – Unique identifier of the OAuth account information. Defaults to a **UUID4**.
|
||||
* `oauth_name` (`str`) – Name of the OAuth service. It corresponds to the `name` property of the OAuth client.
|
||||
* `access_token` (`str`) – Access token.
|
||||
* `expires_at` (`Optional[int]`) - Timestamp at which the access token is expired.
|
||||
|
@ -34,7 +34,7 @@ app.include_router(
|
||||
|
||||
## After register
|
||||
|
||||
You can provide a custom function to be called after a successful registration. It is called with **two argument**: the **user** that has just registered, and the original **`Request` object**.
|
||||
You can provide a custom function to be called after a successful registration. It is called with **two arguments**: the **user** that has just registered, and the original **`Request` object**.
|
||||
|
||||
Typically, you'll want to **send a welcome e-mail** or add it to your marketing analytics pipeline.
|
||||
|
||||
|
@ -45,7 +45,7 @@ You can provide a custom function to be called after a successful update user re
|
||||
* The dictionary containing the updated fields.
|
||||
* The original **`Request` object**.
|
||||
|
||||
It may be useful if you wish for example update your user in a data analytics or customer success platform.
|
||||
It may be useful, for example, if you wish to update your user in a data analytics or customer success platform.
|
||||
|
||||
You can define it as an `async` or standard method.
|
||||
|
||||
|
@ -139,7 +139,7 @@ You can use this token to make authenticated requests as the user `king.arthur@c
|
||||
|
||||
#### Response
|
||||
|
||||
You'll get a empty response. However, the response will come with a `Set-Cookie` header (that's why we added the `-v` option in `cURL` to see them).
|
||||
You'll get an empty response. However, the response will come with a `Set-Cookie` header (that's why we added the `-v` option in `cURL` to see them).
|
||||
|
||||
```
|
||||
set-cookie: fastapiusersauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiYzYwNjBmMTEtNTM0OS00YTI0LThiNGEtYTJhODc1ZGM1Mzk1IiwiYXVkIjoiZmFzdGFwaS11c2VyczphdXRoIiwiZXhwIjoxNTg3ODE4OTQ3fQ.qNA4oPVYhoqrJIk-zvAyEfEVoEnP156G30H_SWEU0sU; HttpOnly; Max-Age=3600; Path=/; Secure
|
||||
|
Reference in New Issue
Block a user