From ba0e89f16aa9fb6014cf601349d2ed5a949d2fb4 Mon Sep 17 00:00:00 2001 From: Nico Coetzee Date: Thu, 29 Apr 2021 07:52:18 +0200 Subject: [PATCH] fix: Fixed two bugs while testing. (Python 3.8.5) --- AC_PKCE/API_server/auth.py | 2 +- AC_PKCE/auth_server/auth.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AC_PKCE/API_server/auth.py b/AC_PKCE/API_server/auth.py index 9fd1f05..d44df7e 100644 --- a/AC_PKCE/API_server/auth.py +++ b/AC_PKCE/API_server/auth.py @@ -10,7 +10,7 @@ def verify_access_token(access_token): try: decoded_token = jwt.decode(access_token.encode(), public_key, issuer = ISSUER, - algorithm = 'RS256') + algorithms = 'RS256') except (jwt.exceptions.InvalidTokenError, jwt.exceptions.InvalidSignatureError, jwt.exceptions.InvalidIssuerError, diff --git a/AC_PKCE/auth_server/auth.py b/AC_PKCE/auth_server/auth.py index d349a0c..afff07e 100644 --- a/AC_PKCE/auth_server/auth.py +++ b/AC_PKCE/auth_server/auth.py @@ -43,8 +43,8 @@ def generate_access_token(): "exp": time.time() + JWT_LIFE_SPAN } - access_token = jwt.encode(payload, private_key, algorithm = 'RS256').decode() - + access_token = jwt.encode(payload, private_key, algorithm = 'RS256') + return access_token def generate_authorization_code(client_id, redirect_url, code_challenge):