I’m trying to use Stoic wallet in my project to authenticate canister calls, but I am getting this error:
There was an error - please ensure you have Cookies Enabled (known issue for Brave users)
The StoicIdentity.load() is not loading anything at all it’s just returning false and that error.
If I initialize my actor soon after connecting, it’s giving the error when I try to make the call:
My current setup:
const updateStoicClient = async () => {
try {
if (typeof window !== "undefined") {
StoicIdentity.load().then(async (identity: any) => {
if (identity !== false) {
initStoicActor(identity);
} else {
identity = await StoicIdentity.connect();
initStoicActor(identity);
}
});
}
} catch (error) {
console.log("Error in connectStoicWallet:", error);
}
};
const initStoicActor = (identity: any) => {
setPrincipalId(identity.getPrincipal().toText());
const _backendActor =
Actor.createActor<ActorSubclass<BACKENDSERVICE> | null>(
backendIDL,
{
agent: new HttpAgent({
identity,
host: host,
}),
canisterId: backendCanisterId,
}
);
setBackendActor(_backendActor);
}
I was using Brave, I tried using Chrome as well and no change, I’m not sure if this is really a cookies problem
I looked in the wallet code, here, it’s looking for _db in localstorage which is not being set, it’s not being set because of the Cookies Being Disabled?
What can I do on my side or something need to be fixed on the wallet side?