o
    Lf                     @   sT   d dl m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 )    )get_adapter)OAuth2AdapterOAuth2CallbackViewOAuth2LoginView   )SalesforceProviderc                   @   sJ   e Zd ZejZedd Zedd Zedd Z	edd Z
d	d
 ZdS )SalesforceOAuth2Adapterc                 C   s   |   jjS )N)get_providerappkeyself r   q/var/www/html/humari/django-venv/lib/python3.10/site-packages/allauth/socialaccount/providers/salesforce/views.pybase_url      z SalesforceOAuth2Adapter.base_urlc                 C      d | jS )Nz{}/services/oauth2/authorizeformatr   r   r   r   r   authorize_url   r   z%SalesforceOAuth2Adapter.authorize_urlc                 C   r   )Nz{}/services/oauth2/tokenr   r   r   r   r   access_token_url   r   z(SalesforceOAuth2Adapter.access_token_urlc                 C   r   )Nz{}/services/oauth2/userinfor   r   r   r   r   userinfo_url   r   z$SalesforceOAuth2Adapter.userinfo_urlc                 K   s:   t   j| jd|id}|  | }|  ||S )Noauth_token)params)r   get_requests_sessiongetr   raise_for_statusjsonr	   sociallogin_from_response)r   requestr
   tokenkwargsresp
extra_datar   r   r   complete_login   s   z&SalesforceOAuth2Adapter.complete_loginN)__name__
__module____qualname__r   idprovider_idpropertyr   r   r   r   r$   r   r   r   r   r      s    



r   N)allauth.socialaccount.adapterr   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   providerr   r   adapter_viewoauth2_loginoauth2_callbackr   r   r   r   <module>   s    
