Rework the documentation

This commit is contained in:
François Voron
2021-09-17 15:14:36 +02:00
parent e31a0a99b5
commit fc59cf11ef
33 changed files with 486 additions and 861 deletions

View File

@@ -1,41 +0,0 @@
# Helpers
**FastAPI Users** provides some helper functions to perform some actions programmatically. They are available from your `FastAPIUsers` instance.
## Create user
Create a user.
```py
regular_user = await fastapi_users.create_user(
UserCreate(
email="king.arthur@camelot.bt",
password="guinevere",
)
)
superuser = await fastapi_users.create_user(
UserCreate(
email="king.arthur@camelot.bt",
password="guinevere",
is_superuser=True,
)
)
```
## Verify user
Verify a user.
```py
verified_user = await fastapi_users.verify_user(non_verified_user)
assert verified_user.is_verified is True
```
## Get user
Retrieve a user by e-mail.
```py
user = await fastapi_users.get_user("king.arthur@camelot.bt")
```