Commit 77987a55 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch '978-token-auth-does-not-return-json' into 'master'

Resolve "/api/v1/token-auth does not return json on login failure"

Closes #975

See merge request !1492
parents 2787c226 1437519d
......@@ -47,7 +47,7 @@ class ObtainThaliaAuthToken(ObtainAuthToken):
if not serializer.is_valid():
return HttpResponse("Unauthorized", status=401)
return Response({"error": "Unauthorized"}, status=401)
user = serializer.validated_data["user"]
token, created = Token.objects.get_or_create(user=user)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment