def METHOD_NAME(cls, info: ResolveInfo, email, password):
    site_settings = get_site_promise(info.context).get().settings
    user = cls._retrieve_user_from_credentials(email, password)
    if not user:
        raise ValidationError(
            {
                "email": ValidationError(
                    "Please, enter valid credentials",
                    code=AccountErrorCode.INVALID_CREDENTIALS.value,
                )
            }
        )
    if (
        not user.is_confirmed
        and not site_settings.allow_login_without_confirmation
        and site_settings.enable_account_confirmation_by_email
    ):
        raise ValidationError(
            {
                "email": ValidationError(
                    "Account needs to be confirmed via email.",
                    code=AccountErrorCode.ACCOUNT_NOT_CONFIRMED.value,
                )
            }
        )
    if not user.is_active:
        raise ValidationError(
            {
                "email": ValidationError(
                    "Account inactive.",
                    code=AccountErrorCode.INACTIVE.value,
                )
            }
        )
    return user