Skip to content

Commit 8b69aea

Browse files
Ensure validation for v3 in tokenView only happens on refresh token
1 parent 314ab24 commit 8b69aea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/dot_ext/views/authorization.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,12 @@ def validate_v3_token_call(self, request) -> None:
480480
def post(self, request, *args, **kwargs):
481481
path_info = self.request.__dict__.get('path_info')
482482
version = get_api_version_number_from_url(path_info)
483+
url_query = parse_qs(request._body.decode('utf-8'))
484+
grant_type = url_query.get('grant_type', [None])
483485
# If it is not version 3, we don't need to check anything, just return
486+
# We only want to execute this on refresh_token grant types, not authorization_code
484487
try:
485-
if version == Versions.V3:
488+
if version == Versions.V3 and grant_type[0] and grant_type[0] == 'refresh_token':
486489
self.validate_v3_token_call(request)
487490
self.validate_token_endpoint_request_body(request)
488491
app = validate_app_is_active(request)

0 commit comments

Comments
 (0)