diff --git a/src/libtimed/oidc.py b/src/libtimed/oidc.py index 6bfd831..47773ca 100644 --- a/src/libtimed/oidc.py +++ b/src/libtimed/oidc.py @@ -6,7 +6,7 @@ import json import time import webbrowser -from urllib.parse import urlparse +from urllib.parse import parse_qs, urlparse import keyring import requests @@ -19,7 +19,7 @@ def do_GET(self): # noqa: N802 url_path = self.path # get the "code" parameter from the query string try: - OIDCHTTPRequestHandler.code = urlparse(url_path).query.split("=")[2] + OIDCHTTPRequestHandler.code = parse_qs(urlparse(url_path).query)["code"][0] except IndexError: self.send_response(400) self.send_header("Content-type", "text/html")