diff --git a/sigstore/_internal/oidc/oauth.py b/sigstore/_internal/oidc/oauth.py index b16a355b8..eed0950aa 100644 --- a/sigstore/_internal/oidc/oauth.py +++ b/sigstore/_internal/oidc/oauth.py @@ -45,6 +45,12 @@ def log_message(self, _format: str, *_args: Any) -> None: def do_GET(self) -> None: server = cast(RedirectServer, self.server) + + # If the auth response has already been populated, the main thread will be stopping this + # thread and accessing the auth response shortly so we should stop servicing any requests. + if not server.active: + return None + r = urllib.parse.urlsplit(self.path) # Handle auth response