I am currently working on developing an app for a project where a user login and authentication is needed. I am receiving this error: " AttributeError: module ‘streamlit_authenticator’ has no attribute ‘PasswordHashingMethod’ ". Can someone please help explain what this means? My code has been posted below.
import streamlit as st
import streamlit_authenticator as sa
import smtplib
auth = sa.Authenticate(
token_url=“/token”,
token_ttl=3600,
password_hashing_method = sa.PasswordHashingMethod,
)
@auth.login_required
def protected():
st.write(“This is a protected route.”)
@st.route(“/login”)
def login():
username = st.text_input(“Username”)
password = st.text_input(“Password”, type=“password”)
if st.button("Login"):
user = auth.authenticate(username, password)
if user is not None:
auth.login_user(user)
st.success("Logged in successfully.")
else:
st.error("Invalid username or password.")
@st.route(“/password-reset”)
def password_reset():
email = st.text_input(“Enter your email address”)
if st.button(“Reset Password”):
reset_link = auth.generate_password_reset_link(email)