Update modules/auth/auth.py
Browse files- modules/auth/auth.py +7 -2
modules/auth/auth.py
CHANGED
@@ -168,12 +168,17 @@ def logout():
|
|
168 |
finally:
|
169 |
st.session_state.clear()
|
170 |
|
|
|
171 |
def hash_password(password):
|
172 |
-
"""Hashea una contraseña"""
|
|
|
173 |
return bcrypt.hashpw(
|
174 |
password.encode('utf-8'),
|
175 |
-
bcrypt.gensalt()
|
176 |
).decode('utf-8')
|
|
|
|
|
|
|
177 |
|
178 |
def verify_password(stored_password, provided_password):
|
179 |
"""Verifica una contraseña"""
|
|
|
168 |
finally:
|
169 |
st.session_state.clear()
|
170 |
|
171 |
+
########################################################
|
172 |
def hash_password(password):
|
173 |
+
"""Hashea una contraseña usando bcrypt"""
|
174 |
+
# Usar 12 rondas para el salt, que es lo que se ve en el hash proporcionado
|
175 |
return bcrypt.hashpw(
|
176 |
password.encode('utf-8'),
|
177 |
+
bcrypt.gensalt(rounds=12)
|
178 |
).decode('utf-8')
|
179 |
+
########################################################
|
180 |
+
|
181 |
+
|
182 |
|
183 |
def verify_password(stored_password, provided_password):
|
184 |
"""Verifica una contraseña"""
|