o
    ˷e"                     @   sP   d dl Z d dlmZmZmZ ddlmZ G dd deZeeZ	eeZ
dS )    N)OAuth2AdapterOAuth2CallbackViewOAuth2LoginView   )StackExchangeProviderc                   @   s&   e Zd ZejZdZdZdZdd Z	dS )StackExchangeOAuth2Adapterz,https://stackexchange.com/oauth/access_tokenzhttps://stackexchange.com/oauthz$https://api.stackexchange.com/2.1/mec           	      K   sT   |   }| }tj| j|j|j|dd}|  | d d }|   	||S )N)access_tokenkeysite)paramsitemsr   )
get_providerget_siterequestsgetprofile_urltokenr	   raise_for_statusjsonsociallogin_from_response)	selfrequestappr   kwargsproviderr
   resp
extra_data r   j/var/www/ideatree/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/stackexchange/views.pycomplete_login   s   z)StackExchangeOAuth2Adapter.complete_loginN)
__name__
__module____qualname__r   idprovider_idaccess_token_urlauthorize_urlr   r   r   r   r   r   r      s    r   )r   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   r   r   r   adapter_viewoauth2_loginoauth2_callbackr   r   r   r   <module>   s    
