Get user token
        Checks if a custom token implementation is registered and uses that.
        Otherwise falls back to default token implementation. Returns a string
        token on success.

        :param user_id: int, user id
        :return: str

def get_token(self, user_id):
        """
        Get user token
        Checks if a custom token implementation is registered and uses that.
        Otherwise falls back to default token implementation. Returns a string
        token on success.

        :param user_id: int, user id
        :return: str
        """
        if not self.jwt_implementation:
            return self.default_token_implementation(user_id)

        try:
            implementation = import_string(self.jwt_implementation)
        except ImportError:
            msg = 'Failed to import custom JWT implementation. '
            msg += 'Check that configured module exists [{}]'
            raise x.ConfigurationException(msg.format(self.jwt_implementation))

        # return custom token
        return implementation(user_id)