def METHOD_NAME(
    event: identity_fn.AuthBlockingEvent,
) -> identity_fn.BeforeCreateResponse | None:
    # [END v2beforeCreateFunctionTrigger]
    # [START v2readUserData]
    # User data passed in from the CloudEvent.
    user = event.data
    # [END v2readUserData]
    # [START v2domainHttpsError]
    # Only users of a specific domain can sign up.
    if user.email is None or "@acme.com" not in user.email:
        # Return None so that Firebase Auth rejects the account creation.
        raise https_fn.HttpsError(
            code=https_fn.FunctionsErrorCode.INVALID_ARGUMENT,
            message="Unauthorized email",
        )
    # [END v2domainHttpsError]