
    Sњh                     T    S SK r S SKJr  S SKJr  S SKJr   " S S\5      r\" 5       rg)    N)HttpRequest)AuthBase)authenticate_by_x_session_tokenc                   b    \ rS rSr% SrSr\\S'   S\4S jr	S\S\
R                  \   4S jrS	rg
)XSessionTokenAuth
   zh
This security class uses the X-Session-Token that django-allauth
is using for authentication purposes.
apiKeyopenapi_typerequestc                 b    U R                  U5      nU(       a  [        U5      nU(       a  US   $ g )Nr   )get_session_tokenr   )selfr   tokenuser_sessions       bD:\Anime\Ugyen\janka_web_project\venv\Lib\site-packages\allauth/headless/contrib/ninja/security.py__call__XSessionTokenAuth.__call__   s/    &&w/:5AL#A&    returnc                 8    UR                   R                  S5      $ )z
Returns the session token for the given request, by looking up the
``X-Session-Token`` header. Override this if you want to extract the token
from e.g. the ``Authorization`` header.
zX-Session-Token)headersget)r   r   s     r   r   #XSessionTokenAuth.get_session_token   s     ""#455r    N)__name__
__module____qualname____firstlineno____doc__r
   str__annotations__r   r   typingOptionalr   __static_attributes__r   r   r   r   r   
   s;    
 !L#  6 69M 6r   r   )	r"   django.httpr   ninja.security.baser   $allauth.headless.internal.sessionkitr   r   x_session_token_authr   r   r   <module>r)      s(     # ( P6 62 )* r   