@dxos/app-toolkit - v0.16.0
    Preparing search index...

    Variable signUpWithEmailConst

    signUpWithEmail: <E>(
        ...args: [
            {
                code?: string;
                email: string;
                ensureIdentity: Effect<Identity, E>;
                hub: HubHttpClient;
            },
        ],
    ) => Effect<
        { accountId: string; email: string; emailVerificationSent: boolean },

            | EmailAlreadyRegisteredError
            | EmailProbeUnavailableError
            | {
                cause?: unknown;
                context: Record<string, unknown>;
                name: "AccountRedemptionError";
                stack?: string;
                get _tag(): Name;
                get message(): string;
            }
            | E,
        never,
    > = ...

    Email sign-up: probe that the address is free, create the local identity, then redeem the access code. Probing comes first because redemption rejects a taken address and an identity created before that rejection is stranded — it cannot be bound to any account.

    ensureIdentity is injected so the caller's operation invoker creates the identity (firing IdentityCreated, which provisions the identity's spaces).

    Type declaration

      • <E>(
            ...args: [
                {
                    code?: string;
                    email: string;
                    ensureIdentity: Effect<Identity, E>;
                    hub: HubHttpClient;
                },
            ],
        ): Effect<
            { accountId: string; email: string; emailVerificationSent: boolean },

                | EmailAlreadyRegisteredError
                | EmailProbeUnavailableError
                | {
                    cause?: unknown;
                    context: Record<string, unknown>;
                    name: "AccountRedemptionError";
                    stack?: string;
                    get _tag(): Name;
                    get message(): string;
                }
                | E,
            never,
        >
      • Type Parameters

        • E

        Parameters

        • ...args: [
              {
                  code?: string;
                  email: string;
                  ensureIdentity: Effect<Identity, E>;
                  hub: HubHttpClient;
              },
          ]

        Returns Effect<
            { accountId: string; email: string; emailVerificationSent: boolean },

                | EmailAlreadyRegisteredError
                | EmailProbeUnavailableError
                | {
                    cause?: unknown;
                    context: Record<string, unknown>;
                    name: "AccountRedemptionError";
                    stack?: string;
                    get _tag(): Name;
                    get message(): string;
                }
                | E,
            never,
        >