
    )Jf                         d dl mZ d dlmZ d dlmZmZmZ ddlm	Z	  G d de          Z
 ej        e
          Z ej        e
          ZdS )	    )app_settings)get_adapter)OAuth2AdapterOAuth2CallbackViewOAuth2LoginView   )OrcidProviderc                   j   e Zd Zej        ZdZdZej	        
                    ei           Ze
                    de          Ze
                    de          Zd                    erdnde          Zd                    e          Zd	                    e          Zd
                    e          Zd ZdS )OrcidOAuth2AdapterFz	orcid.orgBASE_DOMAIN
MEMBER_APIz{0}.{1}apipubzhttps://{0}/oauth/authorizezhttps://{0}/oauth/tokenzhttps://{0}/v2.1/%s/recordc                 8   i }| j         r
|j        |d<   t                                                                          | j        |d         d         z  |ddi          }|                                }|                                                     ||          S )Naccess_tokenresponseorcidacceptzapplication/orcid+json)paramsheaders)	
member_apitokenr   get_requests_sessiongetprofile_urljsonget_providersociallogin_from_response)selfrequestappr   kwargsr   resp
extra_datas           n/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/orcid/views.pycomplete_loginz!OrcidOAuth2Adapter.complete_login   s    ? 	1%*[F>" MM!!##S 6*#5g#>>!#;<    	 YY[[
  ""<<WjQQQ    N)__name__
__module____qualname__r	   idprovider_idmember_api_defaultbase_domain_defaultr   	PROVIDERSr   settingsbase_domainr   format
api_domainauthorize_urlaccess_token_urlr   r&    r'   r%   r   r      s        "K %%))+r::H,,}.ABBKl,>??J!!:"@%%5+NNJ188EEM077
CC.55jAAKR R R R Rr'   r   N)allauth.socialaccountr   allauth.socialaccount.adapterr   ,allauth.socialaccount.providers.oauth2.viewsr   r   r   providerr	   r   adapter_viewoauth2_loginoauth2_callbackr6   r'   r%   <module>r>      s    . . . . . . 5 5 5 5 5 5          $ # # # # #"R "R "R "R "R "R "R "RJ ,+,>??1$12DEEr'   