Sanity Library Reference Docs
    Preparing search index...

    Interface AuthStateBeta

    The unit an AuthStore emits to determine the user's authentication state.

    interface AuthState {
        authenticated: boolean;
        client: SanityClient;
        currentUser: CurrentUser;
    }
    Index

    Properties

    authenticated: boolean

    Similar to a logged-in flag. This state is used in places like the AuthBoundary to determine whether or not it should render the NotAuthenticatedComponent. Implementers may choose to set this to true while also also emitting a currentUser of null if a null user is accepted (e.g. a project that doesn't require a login)

    client: SanityClient

    A client that is expected to be pre-configured to allow for any downstream requests in the Studio

    currentUser: CurrentUser

    The value of the user logged in or null if none is provided