U
    Z!cp                     @   sp   d dl Z d dlmZ d dlmZmZmZ ddlmZ e	edi 
di ZG dd	 d	eZeeZeeZdS )
    N)settings)OAuth2AdapterOAuth2CallbackViewOAuth2LoginView   )MediaWikiProviderZSOCIALACCOUNT_PROVIDERSZ	mediawikic                   @   s>   e Zd ZejZeddZed Z	ed Z
ed Zdd ZdS )	MediaWikiOAuth2AdapterREST_APIz%https://meta.wikimedia.org/w/rest.phpz/oauth2/access_tokenz/oauth2/authorizez/oauth2/resource/profilec                 K   s>   t j| jddj|jdid}|  | }|  ||S )NZAuthorizationzBearer {token})token)headers)	requestsgetprofile_urlformatr
   Zraise_for_statusjsonget_providerZsociallogin_from_response)selfrequestZappr
   kwargsZresp
extra_data r   s/var/www/html/crackeverytest/cet_env/lib/python3.8/site-packages/allauth/socialaccount/providers/mediawiki/views.pycomplete_login   s    z%MediaWikiOAuth2Adapter.complete_loginN)__name__
__module____qualname__r   idZprovider_idr   r   r	   Zaccess_token_urlZauthorize_urlr   r   r   r   r   r   r      s   r   )r   Zdjango.confr   Z,allauth.socialaccount.providers.oauth2.viewsr   r   r   Zproviderr   getattrr   r   Zadapter_viewZoauth2_loginZoauth2_callbackr   r   r   r   <module>   s   
