Home / Function/ get_current_user() — fastapi Function Reference

get_current_user() — fastapi Function Reference

Architecture documentation for the get_current_user() function in tutorial003_an_py310.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  8d8a72e1_eb1e_3237_a57e_9585fa2a2c11["get_current_user()"]
  653dcef2_ec66_9904_437a_1da8f4b471f5["tutorial003_an_py310.py"]
  8d8a72e1_eb1e_3237_a57e_9585fa2a2c11 -->|defined in| 653dcef2_ec66_9904_437a_1da8f4b471f5
  9a4fa957_5fef_0673_b358_06a28bc9aeac["fake_decode_token()"]
  8d8a72e1_eb1e_3237_a57e_9585fa2a2c11 -->|calls| 9a4fa957_5fef_0673_b358_06a28bc9aeac
  style 8d8a72e1_eb1e_3237_a57e_9585fa2a2c11 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/security/tutorial003_an_py310.py lines 58–66

async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
    user = fake_decode_token(token)
    if not user:
        raise HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Not authenticated",
            headers={"WWW-Authenticate": "Bearer"},
        )
    return user

Domain

Subdomains

Frequently Asked Questions

What does get_current_user() do?
get_current_user() is a function in the fastapi codebase, defined in docs_src/security/tutorial003_an_py310.py.
Where is get_current_user() defined?
get_current_user() is defined in docs_src/security/tutorial003_an_py310.py at line 58.
What does get_current_user() call?
get_current_user() calls 1 function(s): fake_decode_token.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free