I’m using tkey and a service worker to implement social login without popup in a react/wagmi app, it’s working nicely.
However the Web3AuthConnector is not usable in that flow and we need to construct a MockConnector from the created private key.
The problem then is that this MockConnector can only be created after receiving a jwt and creating a private key. As far as I understand, we then cannot initialize it and pass it to wagmi’s createConfig. So when coming back to the app, wagmi cannot use the “autoConnect” feature and keep us logged in.
How could that be worked out? Is there a way to persist the log in in that flow?
Solution found, is to store the private key retrieved from the Torus network through tKey, on localStorage (encrypted), and decrypt/pass it to the MockProvider in createConfig. This works.