
    f                         d dl mZ d dlmZ d dlmZ d dlmZ d dl	mZ
 d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ ej,                  d
d
fdZd Zd Zy
)    )HttpResponseRedirect)render)reverse)app_settings)user_display)ImmediateHttpResponse)get_adapter)flows)	AuthErrorNc                    	 t         j                  rddlm} |j	                  | ||||       |i }t               j	                  | ||||       |t        j                  k(  rt        t        d            S d|||di}|j                  |       t        | dt        j                  z   |      S # t        $ r}|j                  cY d }~S d }~ww xY w)	Nr   internal)providererror	exceptionextra_context)r   r   r   socialaccount_login_cancelled
auth_error)r   coder   z#socialaccount/authentication_error.)allauth_settingsHEADLESS_ENABLEDallauth.headless.socialaccountr   on_authentication_errorr	   r   responser   	CANCELLEDr   r   updater   account_settingsTEMPLATE_EXTENSION)requestr   r   r   r   r   econtexts           X/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/allauth/socialaccount/helpers.pyrender_authentication_errorr#      s    ,,?,,!#+ -   M--' 	. 	
 	####G,K$LMM "
G NN=!-0@0S0SS  ! zzs   AB. .	C7CCCc                     |j                   rddlm} |j                  | |      S t        j
                  j                  | |      S )Nr   r   )is_headlessr   r   complete_loginr
   login)r   socialloginr   s      r"   complete_social_loginr)   >   s8    ;&&w<<;;%%g{;;    c                 `    t         j                  }|st        | j                        S  ||       S )N)r   SOCIALACCOUNT_STRr   user)socialaccountfuncs     r"   socialaccount_user_displayr0   F   s,    ))DM..//r*   )django.httpr   django.shortcutsr   django.urlsr   allauthr   r   allauth.accountr   allauth.account.utilsr   allauth.core.exceptionsr   allauth.socialaccountallauth.socialaccount.adapterr	   allauth.socialaccount.internalr
   $allauth.socialaccount.providers.baser   UNKNOWNr#   r)   r0    r*   r"   <module>r>      sG    , #  4 < . 9 . 5 0 : 

,^<r*   