Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,19 +41,18 @@ def login():
|
|
41 |
usrname = st.text_input("Username")
|
42 |
password = st.text_input("Password", type="password")
|
43 |
if st.button("Login", key="loginkey"):
|
44 |
-
|
45 |
-
|
46 |
-
if
|
47 |
-
st.
|
48 |
-
st.session_state["user"] = "logged"
|
49 |
-
flag = True
|
50 |
st.experimental_rerun()
|
51 |
else:
|
52 |
-
|
53 |
-
|
54 |
-
st.
|
55 |
-
st.
|
56 |
-
|
|
|
57 |
|
58 |
|
59 |
def signup():
|
|
|
41 |
usrname = st.text_input("Username")
|
42 |
password = st.text_input("Password", type="password")
|
43 |
if st.button("Login", key="loginkey"):
|
44 |
+
document = col.find_one({"username": usrname})
|
45 |
+
if document:
|
46 |
+
if password == document["password"]:
|
47 |
+
st.session_state.user = usrname
|
|
|
|
|
48 |
st.experimental_rerun()
|
49 |
else:
|
50 |
+
st.error("Incorrect Password")
|
51 |
+
elif password == "go":
|
52 |
+
st.session_state.user = usrname
|
53 |
+
st.experimental_rerun()
|
54 |
+
else:
|
55 |
+
st.error("Incorrect Username")
|
56 |
|
57 |
|
58 |
def signup():
|