The app is run locally & running Streamlit, version 1.38.0, Python 3.12.6
from src.schemas import Configuration
import streamlit as st
from src.schemas.engine import Engine
from PIL import Image
from streamlit_extras import add_vertical_space as avs
import streamlit_authenticator as stauth
print("streamlit version: ", st.__version__)
st.set_page_config(
page_title="Demo: Page", # Title of the page in your browser tab
layout="wide" # Wide mode
)
#-- adding streamlit authentication
config = Configuration()
streamlit_credentials = config.streamlit_credentials
print("streamlit_credentials: ")
print(streamlit_credentials)
authenticator = stauth.Authenticate(
streamlit_credentials['credentials'],
streamlit_credentials['cookie']['name'],
streamlit_credentials['cookie']['key'],
streamlit_credentials['cookie']['expiry_days'],
)
name, authentication_status, username = authenticator.login('Login', 'main')
if authentication_status == False:
st.error("Username/password is incorrect")
if authentication_status == None:
st.warning("Please enter your username and password")
if authentication_status == False:
st.error('Username/password is incorrect')
elif authentication_status == None:
st.warning('Please enter your username and password')
elif authentication_status:
authenticator.logout('Logout', 'main')
st.sidebar.title("Welcome " + name)
with open('app/src/assets/css/app.css')as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html = True)
Hi blackary, Thank you for your response as this was code I got from another colleague’s github I am trying to run locally. He pretty much said all that is required is to run the following:
You’re welcome to create a new forum post, but if it was me, I would first look at the README and the issues in the Streamlit-Authenticator github repository and see if that’s helpful. If you think it’s a bug with the Streamlit-Authenticator package, you might want to post it as a new issue on there. But, you’re also welcome to post a new topic on the forum about it, and you will probably get some help on here as well.