Spaces:
Runtime error
Runtime error
| # pages/login.py | |
| import streamlit as st | |
| def show_login_page(auth_manager): | |
| """Display login page""" | |
| st.title("🔒 Login to Stock Chart Assistant") | |
| with st.form("login_form"): | |
| username = st.text_input("Username").lower() | |
| password = st.text_input("Password", type="password") | |
| submit = st.form_submit_button("Login") | |
| if submit: | |
| if auth_manager.login(username, password): | |
| st.success("Login successful!") | |
| st.rerun() # Rerun to update the page | |
| else: | |
| st.error("Invalid username or password!") | |
| # Show demo credentials | |
| st.markdown("---") | |
| st.markdown("### Demo Access") | |
| st.info(""" | |
| Use these credentials to try the demo: | |
| - Username: synaptyx | |
| - Password: demo | |
| """) | |
| def show_logout_button(auth_manager): | |
| """Display logout button""" | |
| if st.sidebar.button("Logout"): | |
| auth_manager.logout() | |
| st.rerun() # Rerun to update the page |