o
    &zh                     @   sn   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 G dd deZG d	d
 d
e
ZegZdS )    N)	urlencode)EmailAddress)ProviderAccount)FrontierOAuth2Adapter)OAuth2Providerc                   @   s   e Zd Zdd Zdd ZdS )FrontierAccountc                 C   s   d S )N selfr   r   l/var/www/html/kangema/venv/lib/python3.10/site-packages/allauth/socialaccount/providers/frontier/provider.pyget_profile_url   s   zFrontierAccount.get_profile_urlc                 C   s2   dt | jjd d tddif S )Nz%https://www.gravatar.com/avatar/%s?%semailzutf-8dmp)	hashlibsha256account
extra_datagetlowerencode	hexdigestr   r	   r   r   r   get_avatar_url   s   
zFrontierAccount.get_avatar_urlN)__name__
__module____qualname__r   r   r   r   r   r   r   
   s    r   c                   @   s<   e Zd ZdZdZeZeZdd Z	dd Z
dd Zd	d
 ZdS )FrontierProviderfrontierFrontierc                 C   s   ddg}|S )Nauthcapir   )r
   scoper   r   r   get_default_scope   s   z"FrontierProvider.get_default_scopec                 C   s   t |d S )Ncustomer_id)strr
   datar   r   r   extract_uid!   s   zFrontierProvider.extract_uidc                 C   s(   t |d|d|d|ddS )Nr   lastname	firstname)r   username	last_name
first_name)dictr   r%   r   r   r   extract_common_fields$   s   z&FrontierProvider.extract_common_fieldsc                 C   s*   g }| d}|r|t|ddd |S )Nr   T)r   verifiedprimary)r   appendr   )r
   r&   retr   r   r   r   extract_email_addresses,   s
   
z(FrontierProvider.extract_email_addressesN)r   r   r   idnamer   account_classr   oauth2_adapter_classr"   r'   r.   r3   r   r   r   r   r      s    r   )r   urllib.parser   allauth.account.modelsr   $allauth.socialaccount.providers.baser   .allauth.socialaccount.providers.frontier.viewsr   /allauth.socialaccount.providers.oauth2.providerr   r   r   provider_classesr   r   r   r   <module>   s    
