o
    õÁh%  ã                   @   sX   d dl mZ d dlmZmZmZ G dd„ deƒZG dd„ deƒZe e¡Z	e e¡Z
dS )é    )ÚOAuth)ÚOAuthAdapterÚOAuthCallbackViewÚOAuthLoginViewc                   @   s   e Zd ZdZdd„ ZdS )Ú	TumblrAPIz"http://api.tumblr.com/v2/user/infoc                 C   s   |   | j¡ ¡ }|d d S )NÚresponseÚuser)ÚqueryÚurlÚjson)ÚselfÚdata© r   úc/var/www/html/pos/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/tumblr/views.pyÚget_user_info   s   zTumblrAPI.get_user_infoN)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r   	   s    r   c                   @   s$   e Zd ZdZdZdZdZdd„ ZdS )ÚTumblrOAuthAdapterÚtumblrz*https://www.tumblr.com/oauth/request_tokenz)https://www.tumblr.com/oauth/access_tokenz&https://www.tumblr.com/oauth/authorizec                 C   s,   t ||j|j| jƒ}| ¡ }|  ¡  ||¡S )N)r   Ú	client_idÚsecretÚrequest_token_urlr   Úget_providerÚsociallogin_from_response)r   ÚrequestÚappÚtokenr   ÚclientÚ
extra_datar   r   r   Úcomplete_login   s   z!TumblrOAuthAdapter.complete_loginN)r   r   r   Úprovider_idr   Úaccess_token_urlÚauthorize_urlr    r   r   r   r   r      s    r   N)Ú,allauth.socialaccount.providers.oauth.clientr   Ú+allauth.socialaccount.providers.oauth.viewsr   r   r   r   r   Úadapter_viewÚoauth_loginÚoauth_callbackr   r   r   r   Ú<module>   s    
