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

Enable this example service to work with django-rest-framework-jwt #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewhegarty
Copy link

I made some minor changes to get this example to work with django-rest-framework-jwt (without affecting the core example).

Firstly, calls to DRF failed because of HTTP 415 (unsupported media type) (SO). This was corrected by adding 'Content-Type': 'application/json' header.

Secondly, DRF returns HTTP 400 to indicate authentication failure (docs. This error needs to be caught to indicate auth failure.

Changes:

  1. Added json content-type header
  2. Enabled http.post call to handle error
  3. Enabled login component to catch errors and disallow authentication

2.  Enabled http.post call to handle error
3.  Enabled login component to catch errors and disallow authentication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant