> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/programming/python/frameworks/fastapi/protecting-routes.md).

# Protecting Routes

* Next step is to protect the routes, meaning that the user has to be logged in, in order to be able to perform certain operations
* To do that we will have to modify the function parameters:

```python
def delete_post(id: int, db: Session = Depends(get_db), user_id: int = Depends(oauth2.get_current_user)):
```

* So all this does really, is that it sets up the <mark style="color:orange;">`get_current_user`</mark> function as a dependency meaning that the user has to be logged in
