AIdeaText commited on
Commit
2967b0d
1 Parent(s): 1e95929

Update modules/auth.py

Browse files
Files changed (1) hide show
  1. modules/auth.py +5 -5
modules/auth.py CHANGED
@@ -73,12 +73,12 @@ def authenticate_user(username, password):
73
  if results:
74
  stored_user = results[0]
75
  if verify_password(stored_user['password'], password):
76
- return True, stored_user.get('role') # Retorna el rol exacto almacenado
77
- except exceptions.CosmosHttpResponseError as e:
78
- print(f"Error during authentication: {str(e)}")
 
 
79
 
80
- return False, None
81
-
82
  ########################################################################################################################
83
  def verify_password(stored_password, provided_password):
84
  """Verify a stored password against one provided by user"""
 
73
  if results:
74
  stored_user = results[0]
75
  if verify_password(stored_user['password'], password):
76
+ return True, stored_user.get('role', 'Estudiante')
77
+ return False, None
78
+ except Exception as e:
79
+ logger.error(f"Error durante la autenticación: {str(e)}")
80
+ return False, None
81
 
 
 
82
  ########################################################################################################################
83
  def verify_password(stored_password, provided_password):
84
  """Verify a stored password against one provided by user"""