o
    õÁhƒ  ã                   @   sX   d dl mZ d dlmZmZmZ G dd„ deƒZG dd„ deƒZe e¡Z	e e¡Z
dS )é    )ÚOAuth)ÚOAuthAdapterÚOAuthCallbackViewÚOAuthLoginViewc                   @   s   e Zd ZdZdd„ ZdS )ÚOpenStreetMapAPIz7https://api.openstreetmap.org/api/0.6/user/details.jsonc                 C   s   |   | j¡ ¡ }|d S )NÚuser)ÚqueryÚurlÚjson)ÚselfÚdata© r   új/var/www/html/pos/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/openstreetmap/views.pyÚget_user_info   s   zOpenStreetMapAPI.get_user_infoN)Ú__name__Ú
__module__Ú__qualname__r	   r   r   r   r   r   r   	   s    r   c                   @   s$   e Zd ZdZdZdZdZdd„ ZdS )ÚOpenStreetMapOAuthAdapterÚopenstreetmapz1https://www.openstreetmap.org/oauth/request_tokenz0https://www.openstreetmap.org/oauth/access_tokenz-https://www.openstreetmap.org/oauth/authorizec                 C   s,   t ||j|j| jƒ}| ¡ }|  ¡  ||¡S )N)r   Ú	client_idÚsecretÚrequest_token_urlr   Úget_providerÚsociallogin_from_response)r   ÚrequestÚappÚtokenÚresponseÚclientÚ
extra_datar   r   r   Úcomplete_login   s
   ÿz(OpenStreetMapOAuthAdapter.complete_loginN)r   r   r   Úprovider_idr   Úaccess_token_urlÚauthorize_urlr    r   r   r   r   r      s    r   N)Ú,allauth.socialaccount.providers.oauth.clientr   Ú+allauth.socialaccount.providers.oauth.viewsr   r   r   r   r   Úadapter_viewÚoauth_loginÚoauth_callbackr   r   r   r   Ú<module>   s    
