a
    Qx_W                     @   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   )DisqusProviderc                   @   s*   e Zd ZejZdZdZdZdZ	dd Z
dS )DisqusOAuth2Adapterz.https://disqus.com/api/oauth/2.0/access_token/z+https://disqus.com/api/oauth/2.0/authorize/z-https://disqus.com/api/3.0/users/details.json,c                 K   sH   t j| j|j|j|jdd}|  | d}|  	||}|S )N)Zaccess_tokenZapi_keyZ
api_secret)paramsresponse)
requestsgetprofile_urltokenZ	client_idZsecretZraise_for_statusjsonget_providerZsociallogin_from_response)selfrequestZappr   kwargsZresp
extra_dataZlogin r   d/var/www/html/Ranjet/env/lib/python3.9/site-packages/allauth/socialaccount/providers/disqus/views.pycomplete_login   s    z"DisqusOAuth2Adapter.complete_loginN)__name__
__module____qualname__r   idZprovider_idZaccess_token_urlZauthorize_urlr   Zscope_delimiterr   r   r   r   r   r      s   r   )r   Z,allauth.socialaccount.providers.oauth2.viewsr   r   r   Zproviderr   r   Zadapter_viewZoauth2_loginZoauth2_callbackr   r   r   r   <module>   s
   
