Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 18 of 18 for get_current_active_user (0.12 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs_src/security/tutorial005_an_py39.py

    
    @app.get("/users/me/", response_model=User)
    async def read_users_me(
        current_user: Annotated[User, Depends(get_current_active_user)],
    ):
        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(
        current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])],
    ):
        return [{"item_id": "Foo", "owner": current_user.username}]
    
    
    @app.get("/status/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Sep 29 02:57:38 GMT 2025
    - 5.3K bytes
    - Click Count (0)
  2. docs_src/security/tutorial003_py310.py

                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
                headers={"WWW-Authenticate": "Bearer"},
            )
        return user
    
    
    async def get_current_active_user(current_user: User = Depends(get_current_user)):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 24 19:03:06 GMT 2025
    - 2.4K bytes
    - Click Count (0)
  3. docs/zh/docs/advanced/security/oauth2-scopes.md

    ## 依赖项树与作用域
    
    再次查看这个依赖项树与作用域。
    
    `get_current_active_user` 依赖项包含子依赖项 `get_current_user`,并在 `get_current_active_user`中声明了作用域 `"me"` 包含所需作用域列表 ,在 `security_scopes.scopes` 中传递给 `get_current_user`。
    
    *路径操作*自身也声明了作用域,`"items"`,这也是 `security_scopes.scopes` 列表传递给 `get_current_user` 的。
    
    依赖项与作用域的层级架构如下:
    
    * *路径操作* `read_own_items` 包含:
        * 依赖项所需的作用域 `["items"]`:
        * `get_current_active_user`:
            *  依赖项函数 `get_current_active_user` 包含:
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sun Dec 29 20:41:04 GMT 2024
    - 11.6K bytes
    - Click Count (0)
  4. docs/de/docs/tutorial/security/simple-oauth2.md

    Jetzt werden wir unsere Abhängigkeiten aktualisieren.
    
    Wir möchten den `current_user` *nur* erhalten, wenn dieser Benutzer aktiv ist.
    
    Daher erstellen wir eine zusätzliche Abhängigkeit `get_current_active_user`, die wiederum `get_current_user` als Abhängigkeit verwendet.
    
    Beide Abhängigkeiten geben nur dann einen HTTP-Error zurück, wenn der Benutzer nicht existiert oder inaktiv ist.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Sep 20 15:10:09 GMT 2025
    - 11.2K bytes
    - Click Count (0)
  5. docs/en/docs/tutorial/security/simple-oauth2.md

    ## Update the dependencies { #update-the-dependencies }
    
    Now we are going to update our dependencies.
    
    We want to get the `current_user` *only* if this user is active.
    
    So, we create an additional dependency `get_current_active_user` that in turn uses `get_current_user` as a dependency.
    
    Both of these dependencies will just return an HTTP error if the user doesn't exist, or if is inactive.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sun Aug 31 09:15:41 GMT 2025
    - 9.4K bytes
    - Click Count (0)
  6. docs/es/docs/tutorial/security/simple-oauth2.md

    Ahora vamos a actualizar nuestras dependencias.
    
    Queremos obtener el `current_user` *solo* si este usuario está activo.
    
    Entonces, creamos una dependencia adicional `get_current_active_user` que a su vez utiliza `get_current_user` como dependencia.
    
    Ambas dependencias solo devolverán un error HTTP si el usuario no existe, o si está inactivo.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 16 16:33:45 GMT 2025
    - 10.3K bytes
    - Click Count (0)
  7. docs/pt/docs/tutorial/security/simple-oauth2.md

    Agora vamos atualizar nossas dependências.
    
    Queremos obter o `current_user` *somente* se este usuário estiver ativo.
    
    Portanto, criamos uma dependência adicional `get_current_active_user` que por sua vez usa `get_current_user` como dependência.
    
    Ambas as dependências retornarão apenas um erro HTTP se o usuário não existir ou se estiver inativo.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Nov 12 16:23:57 GMT 2025
    - 10.3K bytes
    - Click Count (0)
  8. fastapi/param_functions.py

        from fastapi import Security, FastAPI
    
        from .db import User
        from .security import get_current_active_user
    
        app = FastAPI()
    
        @app.get("/users/me/items/")
        async def read_own_items(
            current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])]
        ):
            return [{"item_id": "Foo", "owner": current_user.username}]
        ```
        """
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 63K bytes
    - Click Count (0)
Back to Top