Hello,
In my dApp, the auth system is built with Next.js, Moralis & Supabase. All regular MetaMask users who use the dApp have no issues authenticating. However recently, some users who have their Ledger wallet connected to their Metamask are attempting to log in to the dApp and they are not able to do that because of the following error.
Whenever the code
await Moralis.Auth.verify({
network,
signature,
message,
});
is run, the following error takes place:
ERROR TypeError: Converting circular structure to JSON
--> starting at object with constructor 'ClientRequest'
| property 'socket' -> object with constructor 'TLSSocket'
--- property '_httpMessage' closes the circle
at JSON.stringify (<anonymous>)
at sendData (/var/task/node_modules/next/dist/server/api-utils/node.js:288:47)
at ServerResponse.apiRes.send (/var/task/node_modules/next/dist/server/api-utils/node.js:162:31)
at handler (/var/task/.next/server/pages/api/auth/verifyMessage.js:73:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.apiResolver (/var/task/node_modules/next/dist/server/api-utils/node.js:179:9)
at async NextNodeServer.runApi (/var/task/node_modules/next/dist/server/next-server.js:381:9)
at async Object.fn (/var/task/node_modules/next/dist/server/base-server.js:500:37)
at async Router.execute (/var/task/node_modules/next/dist/server/router.js:213:36)
at async NextNodeServer.run (/var/task/node_modules/next/dist/server/base-server.js:619:29)
To reiterate again, this issue ONLY takes place with Ledger wallets that are imported into MetaMask.
I’d appreciate some insight into this.
Thank you so much.