Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
st.title("Bienvenue sur Collabteam 👋")
|
| 4 |
+
|
| 5 |
+
if "is_logged_in" not in st.session_state:
|
| 6 |
+
st.session_state.is_logged_in = False
|
| 7 |
+
|
| 8 |
+
if not st.session_state.is_logged_in:
|
| 9 |
+
st.subheader("Connexion")
|
| 10 |
+
email = st.text_input("Email")
|
| 11 |
+
password = st.text_input("Mot de passe", type="password")
|
| 12 |
+
if st.button("Se connecter"):
|
| 13 |
+
if email == "admin@entreprise.fr" and password == "motdepasse123":
|
| 14 |
+
st.session_state.is_logged_in = True
|
| 15 |
+
st.session_state.role = "admin"
|
| 16 |
+
elif email == "user@entreprise.fr" and password == "motdepasse123":
|
| 17 |
+
st.session_state.is_logged_in = True
|
| 18 |
+
st.session_state.role = "user"
|
| 19 |
+
else:
|
| 20 |
+
st.error("Identifiants incorrects")
|
| 21 |
+
else:
|
| 22 |
+
st.success(f"Bienvenue, {st.session_state.role} ! 🎉")
|
| 23 |
+
st.write("Le reste de l'app viendra ici.")
|