Skip to content

Instantly share code, notes, and snippets.

@velicanu
Created January 4, 2022 09:24
Show Gist options
  • Save velicanu/bfb869f1de17fd2b01c87fdf8ea59e17 to your computer and use it in GitHub Desktop.
Save velicanu/bfb869f1de17fd2b01c87fdf8ea59e17 to your computer and use it in GitHub Desktop.
"""
To use:
# in a python3 virtual env
pip install streamlit
streamlit run password_reset.py
"""
import streamlit as st
def main():
db_user = {"email": "foo", "password": "bar"}
email = st.text_input("email", type="default")
password = st.text_input("password", type="password")
user = {"email": email, "password": password}
if db_user == user:
st.write(f"{email} logged in")
else:
st.write("invalid cred")
st.button("Reset password", on_click=reset_password, kwargs={"email": email})
def reset_password(email):
st.write(f"reset password logic {email}")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment