Skip to content

Commit

Permalink
fix(oidc): improve parameter parsing (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
pree authored Jun 4, 2024
1 parent fc859c1 commit e980d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libtimed/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down

0 comments on commit e980d2a

Please sign in to comment.