Closed ghost closed 1 year ago
Solved!
Needed to use provider
from connector
object. Here's the snippet, this works for injected connector as well as wallet connect via Qrcode, tested with mobile with metamask wallet.
const {address, isConnected, connector} = useAccount();
const handleDidSession = () => {
const provider = await connector.getProvider();
const accountId = await getAccountId(provider, address);
const authMethod = await EthereumWebAuth.getAuthMethod(provider,accountId);
const session = await DIDSession.authorize(authMethod, {
resources: [`ceramic://*`],
expiresInSecs: config.didSession.expiresInSecs,
});
}
Glad you it got resolved!
Description
I am trying to create a did session for users who are connected via walletconnect/ web3 modal. I have the user's account address and can use all hooks from wagmi.
But I am not able to create did session via signing the message.
Technical Information
Here's how I have it in code in my react app
If I replace
provider
withwindow.ethreum
it works in browser, but I want to support other wallets and mobile devices, so I integrated wallet connect and web3 modal. Now I want to create didsession with this config.Running the above code give me this error