
    h                         d dl mZ d dlmZ d dlmZ  e       Z edgd      Zdeded	e	fd
Z
ded	efdZded	efdZy)    )CryptContext)jwt)get_settingspbkdf2_sha256auto)schemes
deprecatedplain_passwordhashed_passwordreturnc                 .    t         j                  | |      S N)pwd_contextverify)r
   r   s     +/var/www/notifications/app/core/security.pyverify_passwordr   	   s    no>>    passwordc                 ,    t         j                  |       S r   )r   hash)r   s    r   get_password_hashr      s    H%%r   datac                     | j                         }d|v rt        |d         |d<   t        j                  |t        j
                  d      }|S )NsubHS256)	algorithm)copystrr   encodesettings
SECRET_KEY)r   	to_encodeencoded_jwts      r   create_access_tokenr$      sG    		I	y/0	%**Y(;(;wOKr   N)passlib.contextr   joser   app.core.configr   r    r   r   boolr   r   dictr$    r   r   <module>r+      sd    (  (>O#4H?C ?# ?$ ?& & &d s r   