SignInGuard

class SignInGuard(userClient: SudoUserClient, callback: SudoPlatformSignInCallback? = null)

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.

Constructors

Link copied to clipboard
constructor(userClient: SudoUserClient, callback: SudoPlatformSignInCallback? = null)

Functions

Link copied to clipboard
suspend fun ensureSignedIn()

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

Link copied to clipboard
suspend fun setCallback(callback: SudoPlatformSignInCallback?)

Sets the callback to be invoked when sign-in is required.