@grow-codes/casdoor - v0.1.0
    Preparing search index...

    Class CasdoorClient

    Client for Casdoor: user flows for backends-for-frontends and idempotent admin operations.

    Every Casdoor {"status":"error"} answer (HTTP 200) and every OAuth error becomes a typed CasdoorError subclass with a casdoorReason.

    Index

    The immutable configuration.

    • Adds a user (org/name, name or e-mail) to roles, creating missing roles.

      Parameters

      Returns Promise<void>

    • Releases connections. Idempotent.

      Returns Promise<void>

    • Creates or aligns an SMTP e-mail provider and lists it on the configured application.

      Parameters

      Returns Promise<{ created: boolean; name: string }>

    • Mails a password reset code. Throws NotFoundError for unknown e-mails (do not reveal it).

      Parameters

      Returns Promise<void>

    • Authenticated round trip with the admin credentials (admin session or client credentials): reads the application. Returns the latency in milliseconds.

      Parameters

      Returns Promise<number>

    • Server version (/api/get-version-info, needs the admin session).

      Parameters

      Returns Promise<string>

    • Headless password sign-in (code flow + PKCE inside the BFF). Throws MfaRequiredError when the user has TOTP and no totpCode/recoveryCode was given, EmailNotVerifiedError when the e-mail is not verified and requireVerifiedEmail is on.

      Parameters

      Returns Promise<TokenSet>

    • Ends the Casdoor session of the token (access or id token). Idempotent.

      Parameters

      Returns Promise<void>