Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BB2-3489: Remove [Object object] errors #1290

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/dot_ext/views/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime, timedelta
from time import strftime

from django.http import JsonResponse
from django.http.response import HttpResponse, HttpResponseBadRequest
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
Expand Down Expand Up @@ -272,6 +273,11 @@ def dispatch(self, request, uuid, *args, **kwargs):

result = super().dispatch(request, *args, **kwargs)

if hasattr(result, "headers") \
and "Location" in result.headers \
and "invalid_scope" in result.headers['Location']:
return JsonResponse({"status_code": 400, "message": "Invalid scopes."})

if hasattr(self, 'oauth2_data'):
application = self.oauth2_data.get('application', None)
if application is not None:
Expand Down
Loading