|
|
@ -48,6 +48,7 @@ from .models import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
from .serializers import (
|
|
|
|
from .serializers import (
|
|
|
|
b64encode,
|
|
|
|
b64encode,
|
|
|
|
|
|
|
|
AuthenticationChangePasswordSerializer,
|
|
|
|
AuthenticationSignupSerializer,
|
|
|
|
AuthenticationSignupSerializer,
|
|
|
|
AuthenticationLoginChallengeSerializer,
|
|
|
|
AuthenticationLoginChallengeSerializer,
|
|
|
|
AuthenticationLoginSerializer,
|
|
|
|
AuthenticationLoginSerializer,
|
|
|
@ -668,6 +669,14 @@ class AuthenticationViewSet(viewsets.ViewSet):
|
|
|
|
# FIXME: expire the token - we need better token handling - using knox? Something else?
|
|
|
|
# FIXME: expire the token - we need better token handling - using knox? Something else?
|
|
|
|
return Response({}, status=status.HTTP_200_OK)
|
|
|
|
return Response({}, status=status.HTTP_200_OK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@action_decorator(detail=False, methods=['POST'], permission_classes=BaseViewSet.permission_classes)
|
|
|
|
|
|
|
|
def change_password(self, request):
|
|
|
|
|
|
|
|
serializer = AuthenticationChangePasswordSerializer(request.user.userinfo, data=request.data)
|
|
|
|
|
|
|
|
serializer.is_valid(raise_exception=True)
|
|
|
|
|
|
|
|
serializer.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Response(status=status.HTTP_200_OK)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestAuthenticationViewSet(viewsets.ViewSet):
|
|
|
|
class TestAuthenticationViewSet(viewsets.ViewSet):
|
|
|
|
authentication_classes = BaseViewSet.authentication_classes
|
|
|
|
authentication_classes = BaseViewSet.authentication_classes
|
|
|
|