Spaces:
Build error
Build error
Update views.py
Browse files
views.py
CHANGED
|
@@ -597,6 +597,49 @@ def show_login_page():
|
|
| 597 |
st.success("Login successful!")
|
| 598 |
time.sleep(1) # Give time for message to show
|
| 599 |
st.rerun()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
|
| 601 |
def get_user_accounts(user_id: str) -> List[Dict]:
|
| 602 |
"""Get list of social accounts for the given user."""
|
|
|
|
| 597 |
st.success("Login successful!")
|
| 598 |
time.sleep(1) # Give time for message to show
|
| 599 |
st.rerun()
|
| 600 |
+
|
| 601 |
+
with tab2:
|
| 602 |
+
with st.form("register_form", clear_on_submit=True):
|
| 603 |
+
col1, col2 = st.columns(2)
|
| 604 |
+
|
| 605 |
+
with col1:
|
| 606 |
+
reg_username = st.text_input(
|
| 607 |
+
"Username",
|
| 608 |
+
help="Choose a unique username"
|
| 609 |
+
)
|
| 610 |
+
reg_email = st.text_input(
|
| 611 |
+
"Email",
|
| 612 |
+
help="Enter your email address"
|
| 613 |
+
)
|
| 614 |
+
|
| 615 |
+
with col2:
|
| 616 |
+
reg_password = st.text_input(
|
| 617 |
+
"Password",
|
| 618 |
+
type="password",
|
| 619 |
+
help="Choose a strong password"
|
| 620 |
+
)
|
| 621 |
+
reg_confirm = st.text_input(
|
| 622 |
+
"Confirm Password",
|
| 623 |
+
type="password",
|
| 624 |
+
help="Re-enter your password"
|
| 625 |
+
)
|
| 626 |
+
|
| 627 |
+
# Password requirements info
|
| 628 |
+
st.markdown("""
|
| 629 |
+
Password must contain:
|
| 630 |
+
- At least 8 characters
|
| 631 |
+
- At least one uppercase letter
|
| 632 |
+
- At least one lowercase letter
|
| 633 |
+
- At least one number
|
| 634 |
+
- At least one special character
|
| 635 |
+
""")
|
| 636 |
+
|
| 637 |
+
submitted = st.form_submit_button("Register")
|
| 638 |
+
if submitted:
|
| 639 |
+
if register_user(reg_username, reg_email, reg_password, reg_confirm):
|
| 640 |
+
st.success("Registration successful! Please login.")
|
| 641 |
+
time.sleep(2) # Give time for message to show
|
| 642 |
+
st.rerun()
|
| 643 |
|
| 644 |
def get_user_accounts(user_id: str) -> List[Dict]:
|
| 645 |
"""Get list of social accounts for the given user."""
|