diff options
author | 2022-07-01 19:46:47 +0400 | |
---|---|---|
committer | 2022-07-01 19:47:13 +0400 | |
commit | 1f7e602e2c4a5a217d4297da6f2318016f48946f (patch) | |
tree | 0dbd6dc5890d81eacd119cca878606cf10ac7e0a /backend/authentication | |
parent | Fix Broken Error Message (diff) |
Handle Improper Output For Unittests
The old testing code only checks the first character of the stdout,
meaning that if a user succeeds in printing a 1 before the rest of the
output, the testing code will consider that a pass and discard the rest.
This change checks that the rest of the stdout is empty as expected.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend/authentication')
-rw-r--r-- | backend/authentication/user.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/backend/authentication/user.py b/backend/authentication/user.py index 6256cae..cd5a249 100644 --- a/backend/authentication/user.py +++ b/backend/authentication/user.py @@ -38,6 +38,10 @@ class User(BaseUser): return f"<@{self.payload['id']}>" @property + def user_id(self) -> str: + return str(self.payload["id"]) + + @property def decoded_token(self) -> dict[str, any]: return jwt.decode(self.token, SECRET_KEY, algorithms=["HS256"]) |