Как реализовать httponly jcookies с помощью простого jwt django rest framework

возможно ли включить httponly cookies в простой jwt django rest framework ?

Serializers.py

class CustomTokenObtainPairSerializer(TokenObtainPairSerializer):
    def validate(self, attrs):
        # The default result (access/refresh tokens)
        data = super(CustomTokenObtainPairSerializer, self).validate(attrs)
        # Custom data you want to include
        data.update({'email': self.user.email})
        data.update({'id': self.user.id})
        data.update({'status':"success"})
        # and everything else you want to send in the response
        return data

Vies.py

class CustomTokenObtainPairView(TokenObtainPairView):
    # Replace the serializer with your custom
    serializer_class = CustomTokenObtainPairSerializer

Вернуться на верх