# users/tokens.py
from rest_framework_simplejwt.tokens import RefreshToken


class CustomToken(RefreshToken):
    @classmethod
    def for_user(cls, user):
        """
        Returns an instance of a token with a user_id claim.
        """
        token = super().for_user(user)
        token["user_id"] = str(user.user_id)
        return token
