mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-07-23 14:09:46 +03:00
update /user/ view to accept token
This commit is contained in:
parent
a3057b7aa1
commit
80e20c02e3
|
@ -14,6 +14,7 @@ from rest_framework.views import APIView
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.generics import GenericAPIView, RetrieveUpdateAPIView
|
from rest_framework.generics import GenericAPIView, RetrieveUpdateAPIView
|
||||||
from rest_framework.permissions import IsAuthenticated, AllowAny
|
from rest_framework.permissions import IsAuthenticated, AllowAny
|
||||||
|
from rest_framework.authentication import TokenAuthentication, SessionAuthentication, BasicAuthentication
|
||||||
|
|
||||||
from .app_settings import (
|
from .app_settings import (
|
||||||
TokenSerializer, UserDetailsSerializer, LoginSerializer,
|
TokenSerializer, UserDetailsSerializer, LoginSerializer,
|
||||||
|
@ -141,6 +142,7 @@ class UserDetailsView(RetrieveUpdateAPIView):
|
||||||
"""
|
"""
|
||||||
serializer_class = UserDetailsSerializer
|
serializer_class = UserDetailsSerializer
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
authentication_classes = (BasicAuthentication, SessionAuthentication, TokenAuthentication)
|
||||||
|
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
return self.request.user
|
return self.request.user
|
||||||
|
|
Loading…
Reference in New Issue
Block a user