
    )Jf                         d dl mZ d dlmZmZmZ ddlmZ  G d de          Z ej	        e          Z
 ej	        e          ZdS )    )get_adapter)OAuth2AdapterOAuth2CallbackViewOAuth2LoginView   )TwitterOAuth2Providerc                   8    e Zd Zej        ZdZdZdZdZ	d Z
d ZdS )TwitterOAuth2Adapterz&https://api.twitter.com/2/oauth2/tokenz&https://twitter.com/i/oauth2/authorizez"https://api.twitter.com/2/users/meTc                 |    |                      |          }|                                                     ||          S )N)get_user_infoget_providersociallogin_from_response)selfrequestappaccess_tokenkwargs
extra_datas         w/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/twitter_oauth2/views.pycomplete_loginz#TwitterOAuth2Adapter.complete_login   s7    ''55
  ""<<WjQQQ    c                 *   |                                                                  }i }|                    |                                                                                      di                      d                    d|j        g          |d<   t                                                                          | j	        dd                    |          i|          }|
                                 |                                d         }|S )	NHEADERS BearerAuthorizationzuser.fields,)urlparamsheadersdata)r   
get_fieldsupdateget_settingsgetjointokenr   get_requests_sessionprofile_urlraise_for_statusjson)r   r'   fieldsr    respr!   s         r   r   z"TwitterOAuth2Adapter.get_user_info   s    ""$$//11t((**7799==iLLMMM#&88Xu{,C#D#D  MM!!##S$%sxx'7'78    	 	yy{{6"r   N)__name__
__module____qualname__r   idprovider_idaccess_token_urlauthorize_urlr)   
basic_authr   r    r   r   r
   r
      sR        '*K?<M6KJR R R    r   r
   N)allauth.socialaccount.adapterr   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   providerr   r
   adapter_viewoauth2_loginoauth2_callbackr6   r   r   <module>r=      s    5 5 5 5 5 5          , + + + + +    =   > ,+,@AA1$12FGGr   