Skip to content

Commit dfee123

Browse files
committed
examine scope erasure in postman
1 parent b16f5ac commit dfee123

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/dot_ext/views/authorization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ def form_valid(self, form):
180180
refresh_token_delete_cnt = 0
181181

182182
try:
183+
if not scopes:
184+
raise oauth2.AccessDeniedError(state=credentials.get("state", None))
183185
uri, headers, body, status = self.create_authorization_response(
184186
request=self.request, scopes=scopes, credentials=credentials, allow=allow
185187
)
186-
if not scopes:
187-
raise oauth2.AccessDeniedError(state=credentials.get("state", None))
188188
except OAuthToolkitError as error:
189189
response = self.error_response(error, application)
190190

191-
if allow is False:
191+
if allow is False or not scopes:
192192
(data_access_grant_delete_cnt,
193193
access_token_delete_cnt,
194194
refresh_token_delete_cnt) = remove_application_user_pair_tokens_data_access(application, self.request.user)

0 commit comments

Comments
 (0)