-
I have a custom connector to handle an embedded smart wallet. I'm trying to implement auto connection on page reload, by storing information to connector storage. Storage is configured as cookie, as instructed in the ssr manual. When I connect and reload the page I see the Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Problem solved. My connector implementation of I changed the implementation of |
Beta Was this translation helpful? Give feedback.
Problem solved.
My connector implementation of
getProvider
was returning a variable that was only lazily initialized in theconnect
call.When wagmi hydrates the initial state from the cookie it reads the
recentConnectorId
cookie, searches for that providers, and callgetProvider
. If it returns undefined, which was my case, it skips it, and don't continue the reconnection procedure.I changed the implementation of
getProvider
to check a storage item and also hydrate my provider from it. ThenisAuthorized
is called, followed byconnect
withisReconnecting = true