fix: chat model schema

This commit is contained in:
Timothy J. Baek 2023-12-25 23:43:21 -08:00
parent 8d5c3ee56f
commit 6350d86bde
2 changed files with 21 additions and 17 deletions

View file

@ -98,21 +98,23 @@ class AuthsTable:
def authenticate_user(self, email: str, password: str) -> Optional[UserModel]:
print("authenticate_user", email)
try:
auth = Auth.get(Auth.email == email, Auth.active == True)
print(auth.email)
auth = Auth.get(Auth.email == email, Auth.active == True)
print(auth.email)
if auth:
print(password, str(auth.password))
print(verify_password(password, str(auth.password)))
if verify_password(password, auth.password):
user = Users.get_user_by_id(auth.id)
if auth:
print(password, str(auth.password))
print(verify_password(password, str(auth.password)))
if verify_password(password, auth.password):
user = Users.get_user_by_id(auth.id)
print(user)
return user
print(user)
return user
else:
return None
else:
return None
else:
except:
return None