Skip to content

Commit

Permalink
fix(auth.py): add token verification to ensure tokens are valid befor…
Browse files Browse the repository at this point in the history
…e creating User instance

chore(auth.py): add debug print statement for cognito_user to aid in debugging
  • Loading branch information
NodeJSmith committed Jul 13, 2024
1 parent 4eee152 commit 0690fef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/otf_api/models/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def login(cls, username: str, password: str) -> "User":
def from_token(cls, access_token: str, id_token: str) -> "User":
"""Create a User instance from an id token."""
cognito_user = Cognito(USER_POOL_ID, CLIENT_ID, access_token=access_token, id_token=id_token)
cognito_user.verify_tokens()
cognito_user.check_token()
print(f"{cognito_user=}")
return cls(cognito=cognito_user)

def refresh_token(self) -> "User":
Expand Down

0 comments on commit 0690fef

Please sign in to comment.