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

@@ -9,11 +9,7 @@ from fastapi_users.authentication import CookieAuthentication
SECRET = "SECRET"
auth_backends = []
cookie_authentication = CookieAuthentication(secret=SECRET, lifetime_seconds=3600)
auth_backends.append(cookie_authentication)
```
As you can see, instantiation is quite simple. It accepts the following arguments:
@@ -58,7 +54,3 @@ This method will remove the authentication cookie:
## Authentication
This method expects that you provide a valid cookie in the headers.
## Next steps
We will now configure the main **FastAPI Users** object that will expose the [routers](../routers/index.md).

View File

@@ -9,11 +9,7 @@ from fastapi_users.authentication import JWTAuthentication
SECRET = "SECRET"
auth_backends = []
jwt_authentication = JWTAuthentication(secret=SECRET, lifetime_seconds=3600, tokenUrl="auth/jwt/login")
auth_backends.append(jwt_authentication)
```
As you can see, instantiation is quite simple. It accepts the following arguments:
@@ -69,7 +65,3 @@ from fastapi import Depends, Response
async def refresh_jwt(response: Response, user=Depends(fastapi_users.current_user(active=True))):
return await jwt_authentication.get_login_response(user, response)
```
## Next steps
We will now configure the main **FastAPI Users** object that will expose the [routers](../routers/index.md).