Team Ai
Apppublic

ruby2210/todo-manager

sourceHugging Facemitupdated 9mo agoView on Hugging Face
0likes
deps.cpython-311.pyc32 linesDownload Raw Back to __pycache__
1�

21�mi>����ddlmZmZmZddlmZmZddlmZddl	m3Z4ddlmZddl
mZe��Zee��ee��fdeded	efd5�Zee��fded	eefd�ZdS)
�)�Depends�
HTTPException�status)�6HTTPBearer�HTTPAuthorizationCredentials)�Optional)�get_current_user_id)�get_async_session)�AsyncSession�credentials�db�returnc��vK�|j}t|��}|sttjdddi����|S)ab7    Get current authenticated user ID from JWT token.8 9    Args:10        credentials: HTTP Authorization credentials containing JWT token11        db: Database session (included for potential future user lookup)12 13    Returns:14        User ID if authentication successful15 16    Raises:17        HTTPException: If authentication fails (401 Unauthorized)18    zCould not validate credentialszWWW-Authenticate�Bearer)�status_code�detail�headers)rr	rr�HTTP_401_UNAUTHORIZED)rr
�token�user_ids    �UC:\Users\Dell\OneDrive\Desktop\final-todo\full-stack-todo-app\backend\src\api\deps.py�get_current_userrsT����"
�#�E�!�%�(�(�G��19���4�3�'��2�20�21�22�	23��N�c��2K�|j}t|��S)z�24    Get current authenticated user ID from JWT token (optional).25 26    Args:27        credentials: HTTP Authorization credentials containing JWT token28 29    Returns:30        User ID if authentication successful, None if invalid31    )rr	)rrs  r�get_optional_current_userr*s����
�#�E��u�%�%�%rN)�fastapirrr�fastapi.securityrr�typingr�src.auth.utilsr	�src.database.sessionr32�sqlalchemy.ext.asyncior�security�strrr�rr�<module>r%s&��2�2�2�2�2�2�2�2�2�2�E�E�E�E�E�E�E�E�������.�.�.�.�.�.�2�2�2�2�2�2�/�/�/�/�/�/��:�<�<��18���0A�0A��w�0�1�1���-����	�����>18���0A�0A�
&�
&�-�
&�
�c�]�
&�
&�
&�
&�
&�
&r