"""Utils serializers."""

# DRF
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer

# Serializers
from {{project_slug}}.users.serializers import UserModelSerializer


class CustomObtainPairSerializer(TokenObtainPairSerializer):
    @classmethod
    def get_token(cls, user):
        token = super().get_token(user)

        # Add custom claims
        token["user"] = UserModelSerializer(user).data

        return token
