o
    ht                     @   sH   d dl mZ d dlmZmZmZ G dd deZeeZeeZ	dS )    )get_adapter)OAuth2AdapterOAuth2CallbackViewOAuth2LoginViewc                   @   s$   e Zd ZdZdZdZdZdd ZdS )StackExchangeOAuth2Adapterstackexchangez,https://stackexchange.com/oauth/access_tokenzhttps://stackexchange.com/oauthz$https://api.stackexchange.com/2.1/mec           	      K   sZ   |   }| }t  j| j|j|j|dd}|  |	 d d }|   
||S )N)access_tokenkeysite)paramsitemsr   )get_providerget_siter   get_requests_sessiongetprofile_urltokenr	   raise_for_statusjsonsociallogin_from_response)	selfrequestappr   kwargsproviderr
   resp
extra_data r   j/var/www/html/pos/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/stackexchange/views.pycomplete_login   s   z)StackExchangeOAuth2Adapter.complete_loginN)__name__
__module____qualname__provider_idaccess_token_urlauthorize_urlr   r   r   r   r   r   r   	   s    r   N)
allauth.socialaccount.adapterr   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   r   adapter_viewoauth2_loginoauth2_callbackr   r   r   r   <module>   s
    
