Skip to content
#

asyncio

Here are 2,434 public repositories matching this topic...

fastapi
tiangolo
tiangolo commented Jun 12, 2020

First check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answ
mbdnk
mbdnk commented Nov 13, 2021

Hi!
How can I set response headers if the context object does not contain the response key? I need to set a httpOnly cookie when a user authenticates in the system. For db injection I used Extension.

def authenticate_user(username: str, password: str, info: Info) -> AuthenticateResponse:
    db = info.context['db']
    ...
    info.context["response"].set_cookie(key="token", value

Improve this page

Add a description, image, and links to the asyncio topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the asyncio topic, visit your repo's landing page and select "manage topics."

Learn more