Team Ai
Apppublic

programmingwithabdullah/todo-aipowered

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
jwt.cpython-314.pyc17 linesDownload Raw Back to __pycache__
1+
20~�i��f�^RIHtHt^RIHt^RIHtHt^RIHtRRRlltRR	lt	R3Rlt4R#)
�)�datetime�	timedelta)�Optional)�JWTError�jwt)�settingsNc�F�V^8�dQhR\R\\,/#)��data�
expires_delta)�dictrr)�formats"�GD:\hackathon - II\phase - III\phase - iii\phase-III\backend\auth\jwt.py�__annotate__rs��	�	�d�	�8�I�3F�	�c�v�VP4pV'd\P!4V,pM4\P!4\\P5R7,pVP
RVR\P!4/4\P!V\PRR7pV#)z*Create a JWT access token with expiration.)�days�exp�iat�HS256)�	algorithm)6�copyr�utcnowrr�jwt_expiration_days�updater�encode�7secret_key)rr�	to_encode�expire�encoded_jwts&&   r�create_access_tokenr!sy���	�	��I�����"�]�2�����"�Y�H�4P�4P�%Q�Q��
���e�V�U�H�O�O�,=�>�?��*�*�Y��(;�(;�w�O�K��rc�0�V^8�dQhR\R\/#�r8�token�return��strr
)rs"rrrs��	D�	D��	D��	Drc���\P!V\PR.R7pVP	R4pVf\R4hV# \9dp\R\
T424hRp?ii;i)z*Verify a JWT token and return the payload.r)�10algorithms�subNzCould not validate credentialsz Could not validate credentials: )r�decoderr�getrr')r$�payload�user_id�es&   r�verify_tokenr0so��D��*�*�U�H�$7�$7�W�I�N���{�{�5�)���?��;�<�<�����D��9�#�a�&��B�C�C��D�s�A	A�A3�A.�.A3c�0�V^8�dQhR\R\/#r#r&)rs"rrrs�������rc��\P'g\R4h\P!V\P11R.RR/R7#)zo12Decode a JWT token without validation.13DANGER: This is for debugging purposes ONLY. Do not use in production.14zAdecode_token is for debugging only and is disabled in production.r�verify_signatureF)r)�options)r�debug�RuntimeErrorrr+r)r$s&r�decode_tokenr7sI��15�>�>�>��O�16�	17��:�:�
�����9�#�U�+�	�r)N)rr�typingr�joserrrr!r0r7�rr�<module>r;s!��(����	�	D�r