@cfxlabsinc/b2b-services
    Preparing search index...
    Index
    • Parameters

      • __namedParameters: (
            | { client?: CognitoIdentityProviderClient; region: string }
            | { client: CognitoIdentityProviderClient; region?: undefined }
        ) & {
            authDomain: string;
            clientId: string;
            clientSecret: string;
            fetch?: typeof fetch;
            oauthScopes?: readonly string[];
            userPoolId: string;
        }
        • { client?: CognitoIdentityProviderClient; region: string }
        • { client: CognitoIdentityProviderClient; region?: undefined }
        • authDomain: string

          The pool's hosted domain, e.g. auth.cfx.to, without a scheme.

        • clientId: string
        • clientSecret: string
        • Optionalfetch?: typeof fetch
        • OptionaloauthScopes?: readonly string[]

          What authorizeUrl asks for: never more than the app client's allowedOauthScopes.

        • userPoolId: string

      Returns CognitoAuthClient

    • The hosted authorize endpoint, sent straight to identityProvider (Google or a tenant IdP).

      Parameters

      • __namedParameters: {
            codeChallenge: string;
            identityProvider: string;
            redirectUri: string;
            state: string;
        }

      Returns string

    • Starts USER_AUTH: a password checked at once, a passkey's request options, or the sign-in ConfirmSignUp handed back as signUpSession.

      Parameters

      • input: { username: string } & (
            | { password: string; preferredChallenge: "PASSWORD" }
            | { preferredChallenge: "WEB_AUTHN" }
            | { signUpSession: string }
        )

      Returns Promise<
          | { error: CognitoAuthError; ok: false }
          | { ok: true; value: CognitoAuthStep },
      >

    • The hosted logout, which ends the pool's own session for a federated login and then sends the browser to logoutUri. That must be one of the app client's logoutUrls exactly: its origins, with no path.

      Parameters

      • __namedParameters: { logoutUri: string }

      Returns string

    • Forgot-password for every login, backfilled ones included. A backfilled user is FORCE_CHANGE_PASSWORD with a temporary password nobody was sent, a state ForgotPassword refuses, so it first gets a random permanent one (AdminSetUserPassword, which needs IAM) that the emailed code replaces. A login linked to Google or a tenant IdP never gets a password: it returns as if sent, sending nothing, so its IdP stays the only way in.

      Parameters

      • __namedParameters: { username: string }

      Returns Promise<{ error: CognitoAuthError; ok: false } | { ok: true; value: void }>

    • Self sign-up; Cognito emails a confirmation code. An address that already has a login returns USERNAME_EXISTS, which callers must not reveal.

      Parameters

      • __namedParameters: { email: string; familyName: string; givenName: string; password: string }

      Returns Promise<
          | { error: CognitoAuthError; ok: false }
          | { ok: true; value: { confirmed: boolean } },
      >

    • Which ways in the address's login has, for the email step to offer. A FORCE_CHANGE_PASSWORD login's temporary password was never sent, so it has none. An unknown address answers as a password login.

      Parameters

      • __namedParameters: { email: string }

      Returns Promise<{ ok: true; value: { google: boolean; password: boolean } }>