Skip to content

Fix MemberMiddleware in the API

Tom van Bussel requested to merge fix/member-middleware-drf into master

Closes no issue.

Previous behaviour

Steps to reproduce:

  1. curl -X POST http://127.0.0.1:8000/api/v1/token-auth/ -H 'Content-Type: application/json' -d '{"username": "PUT_USERNAME_HERE", "password": "PUT_PASSWORD_HERE"}'
  2. Copy the resulting token
  3. curl -X GET http://127.0.0.1:8000/api/v1/members/me/ -H 'Authorization: Token PUT_TOKEN_HERE'
  4. Notice that the output is empty.

New behaviour

Steps to validate that it works:

  1. curl -X POST http://127.0.0.1:8000/api/v1/token-auth/ -H 'Content-Type: application/json' -d '{"username": "PUT_USERNAME_HERE", "password": "PUT_PASSWORD_HERE"}'
  2. Copy the resulting token
  3. curl -X GET http://127.0.0.1:8000/api/v1/members/me/ -H 'Authorization: Token PUT_TOKEN_HERE'
  4. Notice that the output is no longer empty.
Edited by Tom van Bussel

Merge request reports