o
    |์f$  ใ                   @   s  G d d de ZG dd deZG dd deZG dd deZG dd	 d	eZG d
d deZG dd deZG dd deZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG d d! d!eZd"S )#c                   @   s   e Zd ZdZdS )ฺSocialAuthBaseExceptionz#Base class for pipeline exceptions.N)ฺ__name__ฺ
__module__ฺ__qualname__ฺ__doc__ฉ r   r   ๚W/var/www/html/humari/django-venv/lib/python3.10/site-packages/social_core/exceptions.pyr      s    r   c                   @   s   e Zd Zdd Zdd ZdS )ฺWrongBackendc                 C   s
   || _ d S ฉNฉฺbackend_name)ฺselfr   r   r   r   ฺ__init__   s   
zWrongBackend.__init__c                 C   ๓   d| j  dS )Nz"Incorrect authentication service "๚"r
   ฉr   r   r   r   ฺ__str__   ๓   zWrongBackend.__str__N)r   r   r   r   r   r   r   r   r   r      s    r   c                   @   ๓   e Zd Zdd ZdS )ฺMissingBackendc                 C   r   )NzMissing backend "z" entryr
   r   r   r   r   r      r   zMissingBackend.__str__Nฉr   r   r   r   r   r   r   r   r      ๓    r   c                   @   ๓   e Zd ZdZdd ZdS )ฺNotAllowedToDisconnectz6User is not allowed to disconnect it's social account.c                 C   ๓   dS )Nz/This account is not allowed to be disconnected.r   r   r   r   r   r      ๓   zNotAllowedToDisconnect.__str__Nฉr   r   r   r   r   r   r   r   r   r      ๓    r   c                       ๓    e Zd ZdZ fddZ  ZS )ฺAuthExceptionzAuth process exception.c                    s   || _ t j|i |ค d S r	   )ฺbackendฺsuperr   )r   r   ฺargsฺkwargsฉฺ	__class__r   r   r      s   zAuthException.__init__)r   r   r   r   r   ฺ__classcell__r   r   r#   r   r      ๓    r   c                       r   )ฺ
AuthFailedz$Auth process failed for some reason.c                    s    t   ก }|dkrdS d| S )Nฺaccess_deniedz#Authentication process was canceledzAuthentication failed: ฉr    r   ฉr   ฺmsgr#   r   r   r   &   s   

zAuthFailed.__str__ฉr   r   r   r   r   r%   r   r   r#   r   r'   #   r&   r'   c                       s,   e Zd ZdZ fddZ fddZ  ZS )ฺAuthCanceledz"Auth process was canceled by user.c                    s$   |  dd ก| _t j|i |ค d S )Nฺresponse)ฺpopr.   r    r   )r   r!   r"   r#   r   r   r   0   s   zAuthCanceled.__init__c                    s   t   ก }|rd| S dS )Nz!Authentication process canceled: zAuthentication process canceledr)   r*   r#   r   r   r   4   s   

zAuthCanceled.__str__ฉr   r   r   r   r   r   r%   r   r   r#   r   r-   -   s    r-   c                       r   )ฺAuthUnknownErrorzUnknown auth process error.c                    ๓   t   ก }d| S )Nz/An unknown error happened while authenticating r)   r*   r#   r   r   r   >   ๓   

zAuthUnknownError.__str__r,   r   r   r#   r   r1   ;   r&   r1   c                       r   )ฺAuthTokenErrorzAuth token error.c                    r2   )NzToken error: r)   r*   r#   r   r   r   F   r3   zAuthTokenError.__str__r,   r   r   r#   r   r4   C   r&   r4   c                       s(   e Zd ZdZ fddZdd Z  ZS )ฺAuthMissingParameterz:Missing parameter needed to start or complete the process.c                    s$   || _ t j|g|ขR i |ค d S r	   )ฺ	parameterr    r   )r   r   r6   r!   r"   r#   r   r   r   N   s   zAuthMissingParameter.__init__c                 C   s   d| j  S )NzMissing needed parameter )r6   r   r   r   r   r   R   s   zAuthMissingParameter.__str__r0   r   r   r#   r   r5   K   s    r5   c                   @   r   )ฺAuthStateMissing๚State parameter is incorrect.c                 C   r   )NzSession value state missing.r   r   r   r   r   r   Y   r   zAuthStateMissing.__str__Nr   r   r   r   r   r7   V   r   r7   c                   @   r   )ฺAuthStateForbiddenr8   c                 C   r   )NzWrong state parameter given.r   r   r   r   r   r   `   r   zAuthStateForbidden.__str__Nr   r   r   r   r   r9   ]   r   r9   c                   @   r   )ฺAuthAlreadyAssociatedzAA different user has already associated the target social accountc                 C   r   )NzThis account is already in use.r   r   r   r   r   r   g   r   zAuthAlreadyAssociated.__str__Nr   r   r   r   r   r:   d   r   r:   c                   @   r   )ฺAuthTokenRevokedz.User revoked the access_token in the provider.c                 C   r   )NzUser revoke access to the tokenr   r   r   r   r   r   n   r   zAuthTokenRevoked.__str__Nr   r   r   r   r   r;   k   r   r;   c                   @   r   )ฺAuthForbiddenz)Authentication for this user is forbiddenc                 C   r   )NzYour credentials aren't allowedr   r   r   r   r   r   u   r   zAuthForbidden.__str__Nr   r   r   r   r   r<   r   r   r<   c                   @   r   )ฺAuthUnreachableProviderzCannot reach the providerc                 C   r   )Nz0The authentication provider could not be reachedr   r   r   r   r   r   |   r   zAuthUnreachableProvider.__str__Nr   r   r   r   r   r=   y   r   r=   c                   @   r   )ฺInvalidEmailc                 C   r   )NzEmail couldn't be validatedr   r   r   r   r   r      r   zInvalidEmail.__str__Nr   r   r   r   r   r>      r   r>   N)ฺ
ValueErrorr   r   r   r   r   r'   r-   r1   r4   r5   r7   r9   r:   r;   r<   r=   r>   r   r   r   r   ฺ<module>   s"    
