From 80e20c02e32c1ae1cd9abea98d3cdc590d8d8868 Mon Sep 17 00:00:00 2001 From: arlyon Date: Mon, 2 Apr 2018 11:22:42 +0100 Subject: [PATCH] update /user/ view to accept token --- rest_auth/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_auth/views.py b/rest_auth/views.py index 8efcdd5..0579f40 100644 --- a/rest_auth/views.py +++ b/rest_auth/views.py @@ -14,6 +14,7 @@ from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.generics import GenericAPIView, RetrieveUpdateAPIView from rest_framework.permissions import IsAuthenticated, AllowAny +from rest_framework.authentication import TokenAuthentication, SessionAuthentication, BasicAuthentication from .app_settings import ( TokenSerializer, UserDetailsSerializer, LoginSerializer, @@ -141,6 +142,7 @@ class UserDetailsView(RetrieveUpdateAPIView): """ serializer_class = UserDetailsSerializer permission_classes = (IsAuthenticated,) + authentication_classes = (BasicAuthentication, SessionAuthentication, TokenAuthentication) def get_object(self): return self.request.user