# Path: rest/auth/serializers.py
# class LoginSerializer(serializers.Serializer):
#     username = serializers.CharField()
#     password = serializers.CharField(style={'input_type': 'password'})


from django.contrib.auth import authenticate, login, logout
from django.middleware import csrf
from rest_framework.response import Response
from rest_framework.exceptions import AuthenticationFailed
from wq.db import rest
from wq.db.rest.models import get_object_id
from wq.db.rest.views import SimpleViewSet
from .serializers import LoginSerializer


class AuthView(SimpleViewSet):
    def user_info(self, request):
        user_dict = rest.router.serialize(request.user)
        user_dict['id'] = get_object_id(request.user)

# Path: rest/auth/serializers.py
# class LoginSerializer(serializers.Serializer):
#     username = serializers.CharField()
#     password = serializers.CharField(style={'input_type': 'password'})


# Path: rest/auth/views.py
from django.contrib.auth import authenticate, login, logout
from django.middleware import csrf
from rest_framework.response import Response
from rest_framework.exceptions import AuthenticationFailed
from wq.db import rest
from wq.db.rest.models import get_object_id
from wq.db.rest.views import SimpleViewSet
from .serializers import LoginSerializer



class AuthView(SimpleViewSet):
    def user_info(self, request):
        user_dict = rest.router.serialize(request.user)
        user_dict['id'] = get_object_id(request.user)

        return Response({