@cfxlabsinc/b2b-services
    Preparing search index...
    type CognitoSignInDeps = {
        passkeyClient: CognitoPasskeyClient;
        recordPasskeyEnrollment: RecordPasskeyEnrollment;
        staffSignIn: boolean;
        totpIssuer: string;
        accountAccess(): Promise<CognitoAccountAccess | null>;
        endSession(): Promise<void>;
        findSsoProvider(input: { email: string }): Promise<string | null>;
        provisionInvitee?(input: { email: string }): Promise<boolean>;
        qrPngBase64(otpauthUri: string): Promise<string>;
        recordSecondFactorRejection(
            input: {
                cognitoSub: string;
                reason: CognitoAuthErrorCode;
                stage: "setup" | "sign-in";
            },
        ): Promise<void>;
        reportError(error: unknown): void;
        savePhoneNumber(input: { phoneNumber: string }): Promise<void>;
        sessionState(): Promise<CognitoSessionState | null>;
        startSession(
            input: {
                inviteId?: string;
                method: NativeSignIn;
                timeZone?: string;
                tokens: CognitoTokens;
            },
        ): Promise<{ error: E; ok: false } | { ok: true; value: T }>;
    }
    Index
    passkeyClient: CognitoPasskeyClient

    The passkey step's Cognito calls: the dashboard's account security service, which publishes each change.

    recordPasskeyEnrollment: RecordPasskeyEnrollment

    Stores whether the login holds a passkey, through the user service's update.

    staffSignIn: boolean

    Whether staff OAuth through cfx-admin is configured here; without it a staff address is refused.

    totpIssuer: string

    The authenticator app's name for the entry, e.g. "CFX".

    • The IdP the address must sign in through: STAFF_IDENTITY_PROVIDER for CFX staff, else the active SSO connection's Cognito provider name for its domain.

      Parameters

      • input: { email: string }

      Returns Promise<string | null>

    • Set where the pool is admin-create-only: gives an address with a PENDING invitation a passwordless login, true when it has one. Sign-up then sets the password by an emailed code, answering the same for any address.

      Parameters

      • input: { email: string }

      Returns Promise<boolean>

    • Records an authenticator code refused at setup or at sign-in, before any session exists, so an operator can see a login stuck on it. A failure is reported, never shown: the screen answers the code either way.

      Parameters

      • input: { cognitoSub: string; reason: CognitoAuthErrorCode; stage: "setup" | "sign-in" }
        • cognitoSub: string

          The challenge's username, which is the login's sub.

        • reason: CognitoAuthErrorCode
        • stage: "setup" | "sign-in"

      Returns Promise<void>

    • Keeps the tokens as the app's session (its cookie) and reads the user they name. A session it refuses is the err, shown as that refusal.

      Parameters

      • input: {
            inviteId?: string;
            method: NativeSignIn;
            timeZone?: string;
            tokens: CognitoTokens;
        }
        • OptionalinviteId?: string
        • method: NativeSignIn

          Which sign-in ran, recorded with the session for its SSO checks.

        • OptionaltimeZone?: string

          The browser's zone, unvalidated: stored only on a row created now.

        • tokens: CognitoTokens

      Returns Promise<{ error: E; ok: false } | { ok: true; value: T }>