You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, in the case of a POST request, the middleware only looks in request.POST for the JWT_QUERYSTRING_ARG key. This works well for submitting forms, however Django request.POST is empty when you submit a request with headers: { "Content-Type": "application/json" }. It only fills up when the content-type is normal HTML form submission values (either multipart/form-data or application/x-www-form-urlencoded). In other cases it is necessary to check in request.body.
It might also be useful to look for the JWT_QUERYSTRING_ARG key in request.GET for POST requests as well as GET requests. This will mean the token can be added on the end of a url as a query-string and might simplify the javascript layer in many cases.
The text was updated successfully, but these errors were encountered:
At the moment, in the case of a POST request, the middleware only looks in
request.POST
for theJWT_QUERYSTRING_ARG
key. This works well for submitting forms, however Djangorequest.POST
is empty when you submit a request withheaders: { "Content-Type": "application/json" }
. It only fills up when the content-type is normal HTML form submission values (either multipart/form-data or application/x-www-form-urlencoded). In other cases it is necessary to check inrequest.body
.It might also be useful to look for the
JWT_QUERYSTRING_ARG
key inrequest.GET
for POST requests as well as GET requests. This will mean the token can be added on the end of a url as a query-string and might simplify the javascript layer in many cases.The text was updated successfully, but these errors were encountered: