aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authentication
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/auth/authentication')
-rw-r--r--gn_auth/auth/authentication/oauth2/endpoints/utilities.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py
index 2c13c66..08b2a3b 100644
--- a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py
+++ b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py
@@ -17,10 +17,17 @@ def query_token(# pylint: disable=[unused-argument]
return val
token = Nothing
with db.connection(current_app.config["AUTH_DB"]) as conn:
- if token_type_hint == "access_token":
- token = token_by_access_token(conn, token_str)
- if token_type_hint == "access_token":
- token = token_by_refresh_token(conn, token_str)
+ match token_type_hint:
+ case "access_token":
+ token = token_by_access_token(
+ conn, token_str
+ )
+ case "refresh_token":
+ token = token_by_refresh_token(
+ conn, token_str
+ )
+ case _:
+ token = Nothing
return token.maybe(
token_by_access_token(conn, token_str).maybe(