fix(api): Replace deprecated is_ajax with manual check
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2709>
This commit is contained in:
parent
6b782907fe
commit
5252c29fa7
|
@ -200,7 +200,7 @@ class AuthorizeView(views.APIView, oauth_views.AuthorizationView):
|
|||
return self.json_payload({"non_field_errors": ["Invalid application"]}, 400)
|
||||
|
||||
def redirect(self, redirect_to, application):
|
||||
if self.request.is_ajax():
|
||||
if self.request.META.get("HTTP_X_REQUESTED_WITH") == "XMLHttpRequest":
|
||||
# Web client need this to be able to redirect the user
|
||||
query = urllib.parse.urlparse(redirect_to).query
|
||||
code = urllib.parse.parse_qs(query)["code"][0]
|
||||
|
|
Loading…
Reference in New Issue