Skip to content

auth

current_user_act_ver_prof(user=Depends(current_user_act_ver)) async

Require a active&verified user, with a non-null profile_id.

Raises 401 if user does not exist or is not active. Raises 403 if user is not verified or has null profile_id.

Source code in fractal_server/app/routes/auth/__init__.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
async def current_user_act_ver_prof(
    user: UserOAuth = Depends(current_user_act_ver),
) -> UserOAuth:
    """
    Require a active&verified user, with a non-null `profile_id`.

    Raises 401 if user does not exist or is not active.
    Raises 403 if user is not verified or has null `profile_id`.
    """
    if user.profile_id is None:
        raise HTTPException(
            status_code=status.HTTP_403_FORBIDDEN,
            detail=(
                f"Forbidden access "
                f"({user.is_verified=} {user.profile_id=})."
            ),
        )
    return user