o
    &zhQ                     @   sT   d dl mZ 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 )    )app_settings)get_adapter)OAuth2AdapterOAuth2CallbackViewOAuth2LoginViewc                   @   sF   e Zd ZdZdZdZdZdZej	
ei Zde
ddiZd	d
 ZdS )RedditAdapterredditz*https://www.reddit.com/api/v1/access_tokenz'https://www.reddit.com/api/v1/authorizez"https://oauth.reddit.com/api/v1/meTz
User-Agent
USER_AGENTzdjango-allauth-headerc                 K   sV   dd|j  i}|| j t  j| j|d}t|tr!|d }| 	 
|| S )NAuthorizationzbearer )headersr   )tokenupdater   r   get_requests_sessiongetprofile_url
isinstancelistget_providersociallogin_from_responsejson)selfrequestappr   kwargsr   
extra_data r   g/var/www/html/kangema/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/reddit/views.pycomplete_login   s   
zRedditAdapter.complete_loginN)__name__
__module____qualname__provider_idaccess_token_urlauthorize_urlr   
basic_authr   	PROVIDERSr   settingsr   r   r   r   r   r   r   
   s    r   N)allauth.socialaccountr   allauth.socialaccount.adapterr   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   r   adapter_viewoauth2_loginoauth2_callbackr   r   r   r   <module>   s    
