CoolFace
Apppublic

deepmindfx/surveillance.chat

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
appnavigation.py29 linesDownload Raw Back to root
1import streamlit as st2 3# Check authentication status - handle None values properly4user_info = st.session_state.get('user_info')5is_authenticated = ('auth_token' in st.session_state and 6                   'user_info' in st.session_state and 7                   user_info is not None and 8                   user_info.get('username'))9 10# Ensure session state keys are initialized11if "video_memories" not in st.session_state:12    st.session_state["video_memories"] = {}13 14# Conditional navigation based on authentication15if is_authenticated:16    # User is logged in - show main app pages17    home = st.Page("home.py", title="Home")18    stream_analysis = st.Page("stream_analysis.py", title="Stream Analysis")19    wait_list = st.Page("wait_list.py", title="Join Waiting List")20    contact = st.Page("contact.py", title="Contact Us")21    pg = st.navigation([home, stream_analysis, wait_list, contact])22else:23    # User is not logged in - show only login page24    login = st.Page("login.py", title="Login / Register")25    pg = st.navigation([login])26 27pg.run()28 29# Sidebar is now handled in home.py