Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with auth token in Forgot password #29

Open
Chirag-N-Sundar opened this issue May 18, 2024 · 3 comments
Open

Problem with auth token in Forgot password #29

Chirag-N-Sundar opened this issue May 18, 2024 · 3 comments

Comments

@Chirag-N-Sundar
Copy link

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 = __login__obj.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
Copy link
Author

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 = __login__obj.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
Copy link

Did you find a fix for this?

@ChiragNSundar
Copy link

Did you find a fix for this?

not yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants