
    Sњh                         S SK JrJr  S SKJr  S SKJr  S SKJ	r	J
r
Jr  S SKJr  S SKJr  S SKJrJr  S SKJrJr      S SS
 jjrS rS rg	)    )PermissionDeniedValidationError)HttpResponseRedirect)app_settings)ImmediateHttpResponseReauthenticationRequiredSignupClosedException)httpkit)AuthenticationStatus)flowsstatekit)	AuthErrorAuthProcessNc                    SnU(       aB  UR                  S5      nUc.  UR                  S5      nU(       a  [        R                  " X5      nSU0nUb+  UR                  S5      nUR                  S5      n	US   US'   O%[        R                  nSn	[
        R                  US'   U(       d  gU	(       d   [        R                  " U S	5      =(       d    S
n	[        R                  " X5      n	[        [        U	5      5      e)zO
Called at a time when it is not clear whether or not this is a headless flow.
Nstatestate_iderrorheadlessnextprocesserror_processsocialaccount_login_error/)getr   unstash_stateallauth_settingsHEADLESS_ONLYr   LOGINr
   get_frontend_urladd_query_paramsr   r   )
requestproviderr   	exceptionextra_contextr   r   paramsr   next_urls
             bD:\Anime\Ugyen\janka_web_project\venv\Lib\site-packages\allauth/headless/socialaccount/internal.pyon_authentication_errorr(      s     E!!'*=$((4H ..wAuF99Z(99V$"'	"2#11"-"3"3++G5PQXUX''9H
 4X >
??    c                 >    [         R                  R                  XSS9$ )NTraises)r   logincomplete_login)r!   sociallogins     r'   complete_token_loginr0   3   s    ;;%%g4%HHr)   c                 $   Sn [         R                  R                  XSS9  [        U 5      n[	        UR
                  (       + UR                  (       + UR                  5       (       + /5      (       a  [        R                  nUR                  S   nU(       a&  [         R"                  " UX!R                  S   S	.5      n[%        U5      $ ! [         a    Sn NU[         a    Sn Nb[         a    Sn No[         a  nUR                  n SnANSnAff = f)
z(
Called when `sociallogin.is_headless`.
NTr+   reauthentication_requiredsignup_closedpermission_deniedr   r   )r   r   )r   r-   r.   r   allis_authenticatedhas_pending_signupget_pending_stager   UNKNOWNr   r	   r   r   coder   r
   r    r   )r!   r/   r   statuser&   s         r'   r.   r.   7   s     E&""7"E$ &g.+++---,,..
 
 %%E  (H++.?.?	.JK
  ))A $ ,+    $# s)   C DD#D0	D9D

D)NNNN)returnN)django.core.exceptionsr   r   django.httpr   allauthr   r   allauth.core.exceptionsr   r   r	   allauth.core.internalr
   !allauth.headless.internal.authkitr   allauth.socialaccount.internalr   r   .allauth.socialaccount.providers.base.constantsr   r   r(   r0   r.    r)   r'   <module>rG      sQ    D , 4 
 * B : Q  @ 
 @FI'*r)   