GauriSP10 / streamlit_login_auth_ui

It lets you connect your streamlit application to a pre-built and secure Login/ Sign-Up page.
MIT License
178 stars 59 forks source link

Problem with auth token in Forgot password #29

Open Chirag-N-Sundar opened 1 month ago

Chirag-N-Sundar commented 1 month ago

TypeError: Courier.init() got an unexpected keyword argument 'auth_token' Traceback: File "C:\Users\chira\AppData\Roaming\Python\Python311\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 600, in _run_script exec(code, module.dict) File "E:\coding\nayi.py", line 11, in LOGGED_IN = loginobj.build_login_ui() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\chira\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit_login_auth_ui\widgets.py", line 307, in build_login_ui self.forgot_password() File "C:\Users\chira\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit_login_auth_ui\widgets.py", line 185, in forgot_password send_passwd_in_email(self.auth_token, username_forgot_passwd, email_forgot_passwd, self.company_name, random_password) File "C:\Users\chira\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit_login_auth_ui\utils.py", line 174, in send_passwd_in_email client = Courier(auth_token=auth_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I tried putting my authcode/api key in the function but it seems to give the same error

Chirag-N-Sundar commented 1 month ago

TypeError: Courier.init() got an unexpected keyword argument 'auth_token' Traceback: File "C:\Users\chira\AppData\Roaming\Python\Python311\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 600, in _run_script exec(code, module.dict) File "E:\coding\nayi.py", line 11, in LOGGED_IN = loginobj.build_login_ui() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\chira\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit_login_auth_ui\widgets.py", line 307, in build_login_ui self.forgot_password() File "C:\Users\chira\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit_login_auth_ui\widgets.py", line 185, in forgot_password send_passwd_in_email(self.auth_token, username_forgot_passwd, email_forgot_passwd, self.company_name, random_password) File "C:\Users\chira\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit_login_auth_ui\utils.py", line 174, in send_passwd_in_email client = Courier(auth_token=auth_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I tried putting my authcode/api key in the function but it seems to give the same error

def send_passwd_in_email(auth_token: str, username_forgot_passwd: str, email_forgot_passwd: str, company_name: str, random_password: str) -> None: """ Triggers an email to the user containing the randomly generated password. """ auth_token ="myauthtokeninserted" client = Courier(auth_token=auth_token)

resp = client.send_message(
message={
    "to": {
    "email": email_forgot_passwd
    },
    "content": {
    "title": company_name + ": Login Password!",
    "body": "Hi! " + username_forgot_passwd + "," + "\n" + "\n" + "Your temporary login password is: " + random_password  + "\n" + "\n" + "{{info}}"
    },
    "data":{
    "info": "Please reset your password at the earliest for security reasons."
    }
}
)
razvanalexuc commented 2 weeks ago

Did you find a fix for this?

Hazard-Chirag commented 2 weeks ago

Did you find a fix for this?

not yet