-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
41 lines (35 loc) · 994 Bytes
/
app.py
File metadata and controls
41 lines (35 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import streamlit as st
from database import init_db
import auth
# Hide the sidebar navigation
st.set_page_config(
page_title="TheraCare",
page_icon="🏥",
layout="centered",
initial_sidebar_state="collapsed"
)
# Initialize database
init_db()
# Initialize session state
if "logged_in" not in st.session_state:
st.session_state.logged_in = False
if "username" not in st.session_state:
st.session_state.username = None
if "token" not in st.session_state:
st.session_state.token = None
if "user_id" not in st.session_state:
st.session_state.user_id = None
if "gorilla_id" not in st.session_state:
st.session_state.gorilla_id = None
# Check authentication
def check_auth():
if not st.session_state.logged_in:
st.switch_page("pages/1_Login.py")
# Main app
def main():
if not st.session_state.logged_in:
st.switch_page("pages/1_Login.py")
else:
st.switch_page("pages/2_Dashboard.py")
if __name__ == "__main__":
main()