o
    h                     @   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                   @   sH   e Zd ZdZedd Zedd Zedd Zedd	 Zd
d Z	dS )SalesforceOAuth2Adapter
salesforcec                 C   s   |   jjS )N)get_providerappkeyself r   g/var/www/html/pos/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|jid}|  | }|  ||S )Noauth_token)params)	r   get_requests_sessiongetr   tokenraise_for_statusjsonr   sociallogin_from_response)r   requestr	   r   kwargsresp
extra_datar   r   r   complete_login   s   z&SalesforceOAuth2Adapter.complete_loginN)
__name__
__module____qualname__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   r   adapter_viewoauth2_loginoauth2_callbackr   r   r   r   <module>   s
    
