Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -3
src/streamlit_app.py
CHANGED
|
@@ -52,9 +52,10 @@ def login_user(email, password):
|
|
| 52 |
"""Logs in an existing user."""
|
| 53 |
users = load_users()
|
| 54 |
user = users.get(email)
|
| 55 |
-
if user and user["password"] == password: # In a real app, compare hashed passwords!
|
| 56 |
return True, user
|
| 57 |
-
|
|
|
|
| 58 |
|
| 59 |
# --- Whisper Model for Audio Transcription ---
|
| 60 |
@st.cache_resource # Caches the model to avoid reloading on rerun
|
|
@@ -153,7 +154,7 @@ if not st.session_state.logged_in:
|
|
| 153 |
st.success(f"Welcome, {st.session_state.user['username']}!")
|
| 154 |
st.rerun() # Rerun to switch to the main app view
|
| 155 |
else:
|
| 156 |
-
st.error(user_or_msg)
|
| 157 |
|
| 158 |
with tab2:
|
| 159 |
st.subheader("New User Registration")
|
|
|
|
| 52 |
"""Logs in an existing user."""
|
| 53 |
users = load_users()
|
| 54 |
user = users.get(email)
|
| 55 |
+
if user and user["password"] == password: # In a real app, compare hashed hashed passwords!
|
| 56 |
return True, user
|
| 57 |
+
# Modified error message to guide the user
|
| 58 |
+
return False, "Invalid email or password. If you don't have an account, please go to the 'Register' tab to create one."
|
| 59 |
|
| 60 |
# --- Whisper Model for Audio Transcription ---
|
| 61 |
@st.cache_resource # Caches the model to avoid reloading on rerun
|
|
|
|
| 154 |
st.success(f"Welcome, {st.session_state.user['username']}!")
|
| 155 |
st.rerun() # Rerun to switch to the main app view
|
| 156 |
else:
|
| 157 |
+
st.error(user_or_msg) # This error message now includes the suggestion to register
|
| 158 |
|
| 159 |
with tab2:
|
| 160 |
st.subheader("New User Registration")
|