Skip to content

Commit 6edc849

Browse files
committed
Errors sorted
1 parent 55c70da commit 6edc849

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/dot_ext/views/authorization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
IntrospectTokenView as DotIntrospectTokenView,
2121
)
2222
from oauth2_provider.models import get_application_model
23+
from oauthlib.oauth2 import AccessDeniedError
2324
from oauthlib.oauth2.rfc6749.errors import InvalidClientError, InvalidGrantError
2425
from urllib.parse import urlparse, parse_qs
2526
import html
@@ -197,7 +198,7 @@ def form_valid(self, form):
197198
access_token_delete_cnt=access_token_delete_cnt,
198199
refresh_token_delete_cnt=refresh_token_delete_cnt,
199200
data_access_grant_delete_cnt=data_access_grant_delete_cnt)
200-
return self.error_response('Requested scopes denied', application)
201+
raise AccessDeniedError(state=credentials.get("state", None))
201202
try:
202203
uri, headers, body, status = self.create_authorization_response(
203204
request=self.request, scopes=scopes, credentials=credentials, allow=allow

0 commit comments

Comments
 (0)