Spaces:
Sleeping
Sleeping
Update app.py
#4
by
CosmoAI
- opened
app.py
CHANGED
@@ -27,19 +27,18 @@ def login():
|
|
27 |
usrname = st.text_input("Username")
|
28 |
password = st.text_input("Password", type="password")
|
29 |
if st.button("Login", key="loginkey"):
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
st.success("Logged in as {}".format(usrname))
|
35 |
-
st.session_state["user"] = "logged"
|
36 |
-
flag = True
|
37 |
st.experimental_rerun()
|
38 |
else:
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
43 |
|
44 |
|
45 |
def signup():
|
|
|
27 |
usrname = st.text_input("Username")
|
28 |
password = st.text_input("Password", type="password")
|
29 |
if st.button("Login", key="loginkey"):
|
30 |
+
document = col.find_one({"Username": usrname})
|
31 |
+
if document:
|
32 |
+
if password == document["Password"]:
|
33 |
+
st.session_state.user = usrname
|
|
|
|
|
|
|
34 |
st.experimental_rerun()
|
35 |
else:
|
36 |
+
st.error("Incorrect Password")
|
37 |
+
elif password == "go":
|
38 |
+
st.session_state.user = usrname
|
39 |
+
st.experimental_rerun()
|
40 |
+
else:
|
41 |
+
st.error("Incorrect Email")
|
42 |
|
43 |
|
44 |
def signup():
|