From 7485f79fc50605f1f9ff1bfafd6202b678811c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Fri, 25 Oct 2019 08:54:05 +0200 Subject: [PATCH] Fix documentation internal links --- docs/configuration/_next_router.md | 3 --- docs/configuration/authentication/_next_authentication.md | 3 --- docs/configuration/authentication/jwt.md | 4 +++- docs/configuration/databases/mongodb.md | 4 +++- docs/configuration/databases/sqlalchemy.md | 8 +++++--- docs/usage/routes.md | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 docs/configuration/_next_router.md delete mode 100644 docs/configuration/authentication/_next_authentication.md diff --git a/docs/configuration/_next_router.md b/docs/configuration/_next_router.md deleted file mode 100644 index b647b5e3..00000000 --- a/docs/configuration/_next_router.md +++ /dev/null @@ -1,3 +0,0 @@ -## Next steps - -We will now configure the main **FastAPI Users** object that will expose the [API router](/configuration/router). diff --git a/docs/configuration/authentication/_next_authentication.md b/docs/configuration/authentication/_next_authentication.md deleted file mode 100644 index 1643e22f..00000000 --- a/docs/configuration/authentication/_next_authentication.md +++ /dev/null @@ -1,3 +0,0 @@ -## Next steps - -We will now configure an [authentication method](/configuration/authentication). diff --git a/docs/configuration/authentication/jwt.md b/docs/configuration/authentication/jwt.md index a9a417d2..937fc2f1 100644 --- a/docs/configuration/authentication/jwt.md +++ b/docs/configuration/authentication/jwt.md @@ -22,4 +22,6 @@ This method expects that you provide a `Bearer` authentication with a valid JWT. curl http://localhost:9000/protected-route -H'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiOTIyMWZmYzktNjQwZi00MzcyLTg2ZDMtY2U2NDJjYmE1NjAzIiwiYXVkIjoiZmFzdGFwaS11c2VyczphdXRoIiwiZXhwIjoxNTcxNTA0MTkzfQ.M10bjOe45I5Ncu_uXvOmVV8QxnL-nZfcH96U90JaocI' ``` -{!./configuration/_next_router.md!} +## Next steps + +We will now configure the main **FastAPI Users** object that will expose the [API router](../router.md). diff --git a/docs/configuration/databases/mongodb.md b/docs/configuration/databases/mongodb.md index 90fd221d..ca07ef21 100644 --- a/docs/configuration/databases/mongodb.md +++ b/docs/configuration/databases/mongodb.md @@ -2,4 +2,6 @@ **Coming soon**. Track the progress of this feature in [ticket #4](https://github.com/frankie567/fastapi-users/issues/4). -{!./configuration/authentication/_next_authentication.md!} +## Next steps + +We will now configure an [authentication method](../authentication/index.md). diff --git a/docs/configuration/databases/sqlalchemy.md b/docs/configuration/databases/sqlalchemy.md index c0d1ca11..43ca9fea 100644 --- a/docs/configuration/databases/sqlalchemy.md +++ b/docs/configuration/databases/sqlalchemy.md @@ -25,7 +25,7 @@ For the sake of this tutorial from now on, we'll use a simple SQLite databse. Let's create a `metadata` object and declare our User table. ```py hl_lines="4 14 15" -{!./src/sqlalchemy.py!} +{!./src/db_sqlalchemy.py!} ``` As you can see, **FastAPI Users** provides a mixin that will include base fields for our User table. You can of course add you own fields there to fit to your needs! @@ -35,7 +35,7 @@ As you can see, **FastAPI Users** provides a mixin that will include base fields We'll now create an SQLAlchemy enigne and ask it to create all the defined tables. ```py hl_lines="18 19 20 21 22" -{!./src/sqlalchemy.py!} +{!./src/db_sqlalchemy.py!} ``` !!!tip @@ -51,7 +51,9 @@ The database adapter of **FastAPI Users** makes the link between your database c Notice that we declare the `users` variable, which is the actual SQLAlchemy table behind the table class. We also use our `database` instance, which allows us to do asynchronous request to the database. -{!./configuration/authentication/_next_authentication.md!} +## Next steps + +We will now configure an [authentication method](../authentication/index.md). ## What about SQLAlchemy ORM? diff --git a/docs/usage/routes.md b/docs/usage/routes.md index 79e73312..cc0aeb83 100644 --- a/docs/usage/routes.md +++ b/docs/usage/routes.md @@ -6,7 +6,7 @@ You'll find here the routes exposed by **FastAPI Users**. Note that you can also ### `POST /register` -Register a new user. +Register a new user. Will call the `on_after_register` [event handlers](../configuration/router.md#event-handlers) on successful registration. !!! abstract "Payload" ```json @@ -54,7 +54,7 @@ Login a user. ### `POST /forgot-password` -Request a reset password procedure. Will generate a temporary token and call the defined `on_after_forgot_password` if the user exists. +Request a reset password procedure. Will generate a temporary token and call the `on_after_forgot_password` [event handlers](../configuration/router.md#event-handlers) if the user exists. To prevent malicious users from guessing existing users in your databse, the route will always return a `202 Accepted` response, even if the user requested does not exist.