o
    &zhY                     @   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edd Zedd Zedd Zdd	 Zd
S )RobinhoodOAuth2Adapter	robinhoodc                 C      dS )Nz+https://www.robinhood.com/oauth2/authorize/ selfr	   r	   j/var/www/html/kangema/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/robinhood/views.pyauthorize_url      z$RobinhoodOAuth2Adapter.authorize_urlc                 C   r   )Nz'https://api.robinhood.com/oauth2/token/r	   r
   r	   r	   r   access_token_url   r   z'RobinhoodOAuth2Adapter.access_token_urlc                 C   r   )Nz"https://api.robinhood.com/user/id/r	   r
   r	   r	   r   profile_url   r   z"RobinhoodOAuth2Adapter.profile_urlc                 K   s8   t   j| jdd|j id}| }|  ||S )NAuthorizationz	Bearer %s)headers)r   get_requests_sessiongetr   tokenjsonget_providersociallogin_from_response)r   requestappr   kwargsresponse
extra_datar	   r	   r   complete_login   s   z%RobinhoodOAuth2Adapter.complete_loginN)	__name__
__module____qualname__provider_idpropertyr   r   r   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
    
