Ë
    ûûàg"  ã                   ó´   — d dl Z d dlmZ d dlmZ d dlmZm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 d d
lmZmZ e	d„ «       Zdefd„Zdefd„Zdefd„Zy)é    N)ÚSimpleNamespace)ÚHttpResponseRedirect)ÚNoReverseMatchÚreverse)Úsync_and_async_middleware)Úiscoroutinefunction)Úget_adapter)Úflows)Úcontext)ÚImmediateHttpResponseÚReauthenticationRequiredc                 óH   ‡ — t        ‰ «      rˆ fd„}nˆ fd„}d„ }||_        |S )Nc              “   óê   •K  — t        «       | _        t        j                  | «      5   ‰| «      ƒ d {  –—† }t	        | |«      rt        | «      ƒ d {  –—† }|cd d d «       S 7 Œ.7 Œ# 1 sw Y   y xY w­w©N)r   Úallauthr   Úrequest_contextÚ_should_redirect_accountsÚ_aredirect_accounts©ÚrequestÚresponseÚget_responses     €úX/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/allauth/account/middleware.pyÚ
middlewarez%AccountMiddleware.<locals>.middleware   sg   øè ø€ Ü-Ó/ˆGŒOÜ×(Ñ(¨Ó1ñ  Ù!-¨gÓ!6×6�Ü,¨W°hÔ?Ü%8¸Ó%A×A�HØ÷	 ñ  Ø6øàAø÷ ð  üs>   ƒ%A3¨A'´A#µA'ÁA%ÁA'Á
A3Á#A'Á%A'Á'A0Á,A3c                 óº   •— t        «       | _        t        j                  | «      5   ‰| «      }t	        | |«      rt        | «      }|cd d d «       S # 1 sw Y   y xY wr   )r   r   r   r   r   Ú_redirect_accountsr   s     €r   r   z%AccountMiddleware.<locals>.middleware!   sQ   ø€ Ü-Ó/ˆGŒOÜ×(Ñ(¨Ó1ñ  Ù'¨Ó0�Ü,¨W°hÔ?Ü1°'Ó:�HØ÷	 ÷  ò  ús   ¦!AÁAc                 ó  — t        |t        «      r|j                  S t        |t        «      rXt	        d«      }t        «       j                  | j                  «      }|r|d   d   }t        j                  j                  | |«      S y )NÚaccount_loginr   Úurl)Ú
isinstancer   r   r   r   r	   Úget_reauthentication_methodsÚuserr
   ÚreauthenticationÚsuspend_request)r   Ú	exceptionÚredirect_urlÚmethodss       r   Úprocess_exceptionz,AccountMiddleware.<locals>.process_exception)   ss   € Ü�iÔ!6Ô7Ø×%Ñ%Ð%Ü˜	Ô#;Ô<Ü" ?Ó3ˆLÜ!“m×@Ñ@ÀÇÁÓNˆGÙØ& q™z¨%Ñ0�Ü×)Ñ)×9Ñ9¸'À<ÓPÐPð =ó    )r   r(   )r   r   r(   s   `  r   ÚAccountMiddlewarer*      s+   ø€ ä˜<Ô(õ	 ô	 òQð $5€JÔ ØÐr)   Úreturnc                 óî   — |j                   dk7  ry	 t        d«      }t        d«      }t        j                  j                  ||g«      }t        |«      dk  s|| j                  k7  ryy# t        $ r Y yw xY w)a…  
    URLs should be hackable. Yet, assuming allauth is included like this...

        path("accounts/", include("allauth.urls")),

    ... and a user would attempt to navigate to /accounts/, a 404 would be
    presented. This code catches that 404, and redirects to either the email
    management overview or the login page, depending on whether or not the user
    is authenticated.
    i”  Fr   Úaccount_emailé   T)Ústatus_coder   r   ÚosÚpathÚcommonprefixÚlen)r   r   Ú
login_pathÚ
email_pathÚprefixs        r   r   r   7   s|   € ð ×Ñ˜sÒ"ØðÜ˜_Ó-ˆ
Ü˜_Ó-ˆ
ô �W‰W×!Ñ! :¨zÐ":Ó;€FÜ
ˆ6ƒ{�aÒ˜6 W§\¡\Ò1Øð øô ò áðús   ’A( Á(	A4Á3A4c              ƒ   ó¤   K  — t        d«      }t        d«      }| j                  «       ƒ d {  –—† }t        |j                  r|«      S |«      S 7 Œ!­w©Nr-   r   )r   Úauserr   Úis_authenticated©r   r5   r4   r"   s       r   r   r   R   sH   è ø€ Ü˜Ó)€JÜ˜Ó)€JØ—‘“× €DÜ¨d×.CÒ.C 
ÓTÐTÈÓTÐTð !ús   ‚*A¬A­"Ac                 ó€   — t        d«      }t        d«      }| j                  }t        |j                  r|«      S |«      S r8   )r   r"   r   r:   r;   s       r   r   r   Y   s:   € Ü˜Ó)€JÜ˜Ó)€JØ�<‰<€DÜ¨d×.CÒ.C 
ÓTÐTÈÓTÐTr)   )r0   Útypesr   Údjango.httpr   Údjango.urlsr   r   Údjango.utils.decoratorsr   Úasgiref.syncr   Úallauth.account.adapterr	   Úallauth.account.internalr
   Úallauth.corer   Úallauth.core.exceptionsr   r   r*   Úboolr   r   r   © r)   r   ú<module>rH      sd   ðÛ 	Ý !å ,ß /Ý =å ,å /Ý *Ý  ÷ð ñ ó ð ðF°Dó ð6UÐ*>ó UðUÐ#7ô Ur)   