• Sets the authentication context for the user in the VS Code global state.

    This stores the user session and authentication status for extension-wide access.

    Parameters

    • user: undefined | User

      The user object to store in global state, or undefined to clear authentication.

    Returns Promise<{ error?: string }>

    An object containing an optional error message.