Stoic identity not working with HttpAgent?

I was trying to use a stoic identity with the exported createActor method from a canisters autogenerated index.js file:

identity = await StoicIdentity.connect();

const agent = new HttpAgent({
  identity,
  host: HOST,
});

const daoStoic = createDaoActor(daoCanisterId, {
  agentOptions: {
    source: agent,
  },
});

the agent was created correctly, but passing it to the createDaoActor method and then checking this daoStoic Actors agent showed that it was using the AnonymousIdentity instead.
using

const daoStoic = createDaoActor(daoCanisterId, {
  agentOptions: {
    identity,
    host: HOST,
  },
});

lead to the desired outcome. does anyone know what’s going on here?

@stephenandrews @kpeacock

1 Like