o
    ˷ed                     @   sb   d dl 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)OAuth2Providerc                       s,   e Zd Zdd Zdd Z fddZ  ZS )FrontierAccountc                 C   s   d S )N selfr   r   h/var/www/ideatree/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md5account
extra_datagetlowerencode	hexdigestr   r   r   r   r
   get_avatar_url   s   
zFrontierAccount.get_avatar_urlc                    s6   t t|  }d| jjd|| jjd|f }|S )Nz%s %s	firstnamelastname)superr   to_strr   r   r   )r	   dflt	full_name	__class__r   r
   r      s   zFrontierAccount.to_str)__name__
__module____qualname__r   r   r   __classcell__r   r   r   r
   r   	   s    r   c                   @   s8   e Zd ZdZd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   r   r   )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_addresses2   s
   
z(FrontierProvider.extract_email_addressesN)r    r!   r"   idnamer   account_classr*   r/   r4   r9   r   r   r   r
   r$      s    r$   )r   urllib.parser   allauth.account.modelsr   $allauth.socialaccount.providers.baser   /allauth.socialaccount.providers.oauth2.providerr   r   r$   provider_classesr   r   r   r
   <module>   s    
