Home / Function/ get_current_user() — fastapi Function Reference

get_current_user() — fastapi Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  090000a1_f55c_f899_3161_8d5e5bfb6ed8["get_current_user()"]
  75cfd1a5_0803_efc1_bd73_03fd35666bbc["tutorial003_py39.py"]
  090000a1_f55c_f899_3161_8d5e5bfb6ed8 -->|defined in| 75cfd1a5_0803_efc1_bd73_03fd35666bbc
  f052adff_9374_d540_6da2_fa808aade01f["fake_decode_token()"]
  090000a1_f55c_f899_3161_8d5e5bfb6ed8 -->|calls| f052adff_9374_d540_6da2_fa808aade01f
  style 090000a1_f55c_f899_3161_8d5e5bfb6ed8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs_src/security/tutorial003_py39.py lines 58–66

async def get_current_user(token: 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_py39.py.
Where is get_current_user() defined?
get_current_user() is defined in docs_src/security/tutorial003_py39.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