added main-controller tests

This commit is contained in:
Lucas Jensen
2024-05-03 21:17:04 -07:00
parent a7f7b0bd48
commit f5f507b20a
11 changed files with 240 additions and 27 deletions

View File

@@ -116,6 +116,14 @@ class UserController(BaseController):
)
def create_user(self, token: HTTPAuthorizationCredentials) -> User:
"""Updates a user's sub in the database and creates a new User object.
Args:
token (HTTPAuthorizationCredentials): The token containing the user's email and sub
Returns:
User: A User object which is suitable for a response body
"""
email, sub = oauth_token.email_and_sub(token)
user: User = self.get_user_by_email(email)
if user.sub is None: