Skip to content

[bug] After logging in via email or social options, the signMessage operation does not work #4070

Closed
@tuzkiiiii233

Description

@tuzkiiiii233

Link to minimal reproducible example

https://test.fusion.gallery/en

Summary

On the first login, the signMessage modal probably persists until the user clicks ‘Sign’ to complete the signing and authentication process. And then, clicking ‘log out’ works as expected. However, when attempting to connect again, the signMessage modal briefly open and then closed without any user interaction, while the console shows error as follows:

{time: 1742890424103, level: 50, context: 'rw', error: Error: Request was aborted
    at AbortSignal.<anonymous> (https://test.fusion.gallery/_next/static…, msg: 'Error requesting'}
{time: 1742890424565, level: 50, context: 'rw', error: Error: Internal error: User denied account access.
    at https://test.fusion.gallery/_next/static/…, msg: 'Error connecting'}

Here is my code:

//appkit
const modal = createAppKit({
  adapters: [wagmiAdapter],
  projectId,
  networks,
  metadata: metadata,
  themeMode: 'light',
  featuredWalletIds: ['c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96'],
  features: {
    analytics: true, // Optional - defaults to your Cloud configuration
    connectMethodsOrder: ['email', 'social', 'wallet'],
  },
  defaultAccountTypes: { eip155: 'eoa' },
})

//sign
  const { isConnected} = useAccount()
  const { signMessage, data: signMsg, reset } = useSignMessage()
  useEffect(() => {
    if (isConnected && signMessage) {
        signMessage({ message: 'log in' })
    }
  }, [isConnected, signMessage])

Notably, this issue does not occur when logging in with a wallet. It only happens with email or social login(github/google). And it’s not always reproducible — it happens about 8 out of 10 times. I don’t know what is causing this issue. I would really appreciate any help. Thanks!

List of related npm package versions

"wagmi": "^2.14.12",
"next": "14.2.3",
"@reown/appkit": "^1.7.0",
"@reown/appkit-adapter-wagmi": "^1.7.0",

Node.js Version

v20.12.2

Package Manager

yarn@1.22.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions