providers/oauth2: always set CORS headers on provider info view
This commit is contained in:
parent
56f75aecc7
commit
de4b3d6290
|
@ -103,9 +103,10 @@ class ProviderInfoView(View):
|
||||||
provider: OAuth2Provider = get_object_or_404(
|
provider: OAuth2Provider = get_object_or_404(
|
||||||
OAuth2Provider, pk=application.provider_id
|
OAuth2Provider, pk=application.provider_id
|
||||||
)
|
)
|
||||||
response = JsonResponse(
|
return JsonResponse(self.get_info(provider), json_dumps_params={"indent": 2})
|
||||||
self.get_info(provider), json_dumps_params={"indent": 2}
|
|
||||||
)
|
|
||||||
response["Access-Control-Allow-Origin"] = "*"
|
|
||||||
|
|
||||||
|
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
|
||||||
|
# Since this view only supports get, we can statically set the CORS headers
|
||||||
|
response = super().dispatch(request, *args, **kwargs)
|
||||||
|
response["Access-Control-Allow-Origin"] = "*"
|
||||||
return response
|
return response
|
||||||
|
|
Reference in New Issue