ic-reactor
    Preparing search index...

    Variable useAuthStateConst

    useAuthState: () => types.AuthState = AgentHooks.useAuthState

    Accesses the current authentication state.

    Type declaration

    function AuthStateComponent() {
      const { authenticated, authenticating, identity, error } = useAuthState();
    
      return (
        
    {authenticating ? 'Authenticating...' : ''} {error ? `Error: ${error.message}` : ''} {authenticated ? `User ${identity?.getPrincipal()} is authenticated.` : 'User is not authenticated.'}
    ); }