async def identify_token(token: str, base_domain: str | None) -> ProviderType:
    """
    Identifies whether a token belongs to GitHub or GitLab.
    Parameters:
        token (str): The personal access token to check.
        base_domain (str): Custom base domain for provider (e.g GitHub Enterprise)
    """
    provider = await validate_provider_token(SecretStr(token), base_domain)
    if not provider:
        raise ValueError('Token is invalid.')

    return provider

    Identifies whether a token belongs to GitHub or GitLab.
    Parameters:
        token (str): The personal access token to check.
        base_domain (str): Custom base domain for provider (e.g GitHub Enterprise)
    
openhands/resolver/utils.py