Result of the useSession hook.

interface UseSessionResult {
    session: null | Session;
    isLoaded: boolean;
    error: null | string;
    isExpired: boolean;
    renew: (() => void);
}

Properties

session: null | Session

The active session, or null if no handle or session creation failed.

isLoaded: boolean

Whether the session (or its absence) has been determined.

error: null | string

Error string if session creation or renewal failed.

isExpired: boolean

Whether the current session has expired.

renew: (() => void)

Manually renew the session (creates a new one with a fresh jti).