Skip to content

Commit 4795d7b

Browse files
committed
Use original error message with OAuthResponseProblem
1 parent 2b208e7 commit 4795d7b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

connexion/security/aiohttp_security_handler_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def wrapper(token):
3737
token_info_url, headers=headers, timeout=self.remote_token_timeout
3838
)
3939
if token_response.status != 200:
40-
raise OAuthResponseProblem(token_response)
40+
raise OAuthResponseProblem(
41+
description="Provided token is not valid",
42+
token_response=token_response
43+
)
4144
return token_response.json()
4245
return wrapper

connexion/security/flask_security_handler_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def wrapper(token):
3636
token_info_url, headers=headers, timeout=self.remote_token_timeout
3737
)
3838
if not token_response.ok:
39-
raise OAuthResponseProblem(token_response)
39+
raise OAuthResponseProblem(
40+
description="Provided token is not valid",
41+
token_response=token_response
42+
)
4043
return token_response.json()
4144
return wrapper

0 commit comments

Comments
 (0)