
    f                         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 d dlmZ d d	lmZ d
eeee   f   fdZded
dfdZy)    )OptionalTuple)messages)get_adapter)"raise_if_reauthentication_required)signals)delete_and_cleanup)Authenticator)auto_generate_recovery_codes)TOTPreturnc                    t        |        t        j                  | j                  |j                        j
                  }t        j                  j                  t        | | j                  |       t        |       }|j                  | t        j                  d       |j                  d| j                         t        |       }||fS )N)senderrequestuserauthenticatorzmfa/messages/totp_activated.txtzmfa/email/totp_activated)r   r   activater   secretinstancer   authenticator_addedsendr
   get_account_adapteradd_messager   SUCCESSsend_notification_mailr   )r   form	totp_authadapterrc_auths        Z/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/allauth/mfa/totp/internal/flows.pyactivate_totpr!      s    &w/gllDKK8AAI$$\\	 %  "'*G!1!13TU""#=w||L*73Gg    r   Nc                     t        |        t        | |       t        |       }|j                  | t        j
                  d       |j                  d| j                         y )Nz!mfa/messages/totp_deactivated.txtzmfa/email/totp_deactivated)r   r	   r   r   r   r   r   r   )r   r   r   s      r    deactivate_totpr$   "   sL    &w/w.!'*G!1!13VW""#?Nr"   )typingr   r   django.contribr   allauth.account.adapterr   r   /allauth.account.internal.flows.reauthenticationr   allauth.mfar   allauth.mfa.base.internal.flowsr	   allauth.mfa.modelsr
   )allauth.mfa.recovery_codes.internal.flowsr   allauth.mfa.totp.internal.authr   r!   r$    r"   r    <module>r/      sY    " # F   > , 0E--9P*P$Q  OM Od Or"   