@sudoplatform/sudo-user
    Preparing search index...

    Class SignInGuard

    A reusable helper class that provides sign-in checking functionality for Sudo Platform libraries.

    This class encapsulates the logic for checking if a user is signed in and invoking a callback to handle sign-in when needed. It is designed to be used by any SudoPlatform Client to provide consistent sign-in callback behavior across the platform.

    Index

    Constructors

    Methods

    • Checks if the user is signed in and invokes the callback if needed.

      This method performs the following:

      1. If no callback is set, returns immediately (backward-compatible behaviour).
      2. Checks if the user is signed in using SudoUserClient.isSignedIn.
      3. If not signed in, invokes the callback's SudoPlatformSignInCallback.signIn method.

      Returns Promise<void>

      Any error thrown by the callback's signIn() method, or errors from checking sign-in status (sign-in status errors are swallowed and treated as "not signed in").