Upload app.py
Browse files
app.py
CHANGED
|
@@ -111,8 +111,11 @@ if not st.session_state.user:
|
|
| 111 |
password = st.text_input("Contrasenya", type="password")
|
| 112 |
if st.button("Entrar", type="primary"):
|
| 113 |
row = get_user(username)
|
| 114 |
-
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
| 116 |
if row and hash_to_check and verify_password(password, hash_to_check):
|
| 117 |
st.session_state.user = {"id": row["id"], "username": row["username"], "role": row["role"]}
|
| 118 |
st.success(f"Benvingut/da, {row['username']}")
|
|
|
|
| 111 |
password = st.text_input("Contrasenya", type="password")
|
| 112 |
if st.button("Entrar", type="primary"):
|
| 113 |
row = get_user(username)
|
| 114 |
+
hash_to_check = None
|
| 115 |
+
if row:
|
| 116 |
+
# Comprobar cualquiera de las dos columnas de hash de contraseña por compatibilidad
|
| 117 |
+
hash_to_check = row["password_hash"] or row["pw_hash"]
|
| 118 |
+
|
| 119 |
if row and hash_to_check and verify_password(password, hash_to_check):
|
| 120 |
st.session_state.user = {"id": row["id"], "username": row["username"], "role": row["role"]}
|
| 121 |
st.success(f"Benvingut/da, {row['username']}")
|