
    fw                         d dl mZ d dlmZmZmZ  G d de      Z ej                  e      Z ej                  e      Z	y)    )get_adapter)OAuth2AdapterOAuth2CallbackViewOAuth2LoginViewc                   ,    e Zd ZdZdZdZdZdZd Zd Z	y)	TwitterOAuth2Adaptertwitter_oauth2z&https://api.twitter.com/2/oauth2/tokenz&https://twitter.com/i/oauth2/authorizez"https://api.twitter.com/2/users/meTc                 d    | j                  |      }| j                         j                  ||      S )N)get_user_infoget_providersociallogin_from_response)selfrequestappaccess_tokenkwargs
extra_datas         o/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/allauth/socialaccount/providers/twitter_oauth2/views.pycomplete_loginz#TwitterOAuth2Adapter.complete_login   s.    ''5
  "<<WjQQ    c                    | j                         j                         }i }|j                  | j                         j                         j	                  di              dj                  d|j                  g      |d<   t               j                         j	                  | j                  ddj                  |      i|      }|j                          |j                         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t((*779==iLM#&88Xu{{,C#D  M!!#S$$%sxx'78   	 	yy{6"r   N)
__name__
__module____qualname__provider_idaccess_token_urlauthorize_urlr(   
basic_authr   r    r   r   r   r   	   s'    "K?<M6KJRr   r   N)
allauth.socialaccount.adapterr   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   r   adapter_viewoauth2_loginoauth2_callbackr4   r   r   <module>r:      sG    5 = > ,++,@A1$112FGr   