U
    [!c                     @   st   d dl mZmZmZ ddlmZ ddlmZ G dd deZG dd deZ	G d	d
 d
eZ
e	eZe
eZdS )   )OAuthAdapterOAuthCallbackViewOAuthLoginView   )PocketOAuthClient)PocketProviderc                   @   s&   e Zd ZejZdZdZdZdd Z	dS )PocketOAuthAdapterz&https://getpocket.com/v3/oauth/requestz(https://getpocket.com/v3/oauth/authorizez$https://getpocket.com/auth/authorizec                 C   s   |   ||S )N)get_providerZsociallogin_from_response)selfrequestapptokenresponse r   p/var/www/html/crackeverytest/cet_env/lib/python3.8/site-packages/allauth/socialaccount/providers/pocket/views.pycomplete_login   s    z!PocketOAuthAdapter.complete_loginN)
__name__
__module____qualname__r   idZprovider_idrequest_token_urlaccess_token_urlZauthorize_urlr   r   r   r   r   r      s
   r   c                   @   s   e Zd Zdd ZdS )PocketOAuthLoginViewc              
   C   s\   | j  }||}d||}i }|r4||d< t||j|j| j j| j j	|||d}|S N scope)
parametersprovider
Zadapterr	   Zget_appjoinZ	get_scoper   Z	client_idZsecretr   r   r
   r   Zcallback_urlr   r   r   r   clientr   r   r   _get_client   s"    


z PocketOAuthLoginView._get_clientNr   r   r   r"   r   r   r   r   r      s   r   c                   @   s   e Zd Zdd ZdS )PocketOAuthCallbackViewc              
   C   s\   | j  }||}d||}i }|r4||d< t||j|j| j j| j j	|||d}|S r   r   r    r   r   r   r"   &   s"    


z#PocketOAuthCallbackView._get_clientNr#   r   r   r   r   r$   %   s   r$   N)Zoauth.viewsr   r   r   r!   r   r   r   r   r   r$   Zadapter_viewZoauth_loginZoauth_callbackr   r   r   r   <module>   s   

