From e21ed928488d64b820765133b29205d40f7d2f21 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 14 Sep 2020 18:40:44 +0200 Subject: [PATCH] providers/oauth2: ensure flow is cleaned up on error --- passbook/providers/oauth2/views/authorize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passbook/providers/oauth2/views/authorize.py b/passbook/providers/oauth2/views/authorize.py index 9a93fe9c2..5a24ca8dd 100644 --- a/passbook/providers/oauth2/views/authorize.py +++ b/passbook/providers/oauth2/views/authorize.py @@ -220,9 +220,11 @@ class OAuthFulfillmentStage(StageView): ) return redirect(self.create_response_uri()) except (ClientIdError, RedirectUriError) as error: + self.executor.stage_invalid() # pylint: disable=no-member return bad_request_message(request, error.description, title=error.error) except AuthorizeError as error: + self.executor.stage_invalid() uri = error.create_uri(self.params.redirect_uri, self.params.state) return redirect(uri)