fix: only get user by emails without oauth sub

This commit is contained in:
Jun Siang Cheah 2024-05-26 11:59:21 +01:00
parent b3557d05b1
commit 7385016e36

View File

@ -114,7 +114,7 @@ class UsersTable:
def get_user_by_email(self, email: str) -> Optional[UserModel]:
try:
user = User.get(User.email == email)
user = User.get(User.email == email and User.oauth_sub.is_null())
return UserModel(**model_to_dict(user))
except:
return None