Magic RPC Error: [-32603] Internal error: User denied account access.
LogicVirtuoso opened this issue ยท 11 comments
โ Prerequisites
- Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
- Are you running the latest SDK version?
- Are you reporting to the correct repository (
magic-sdk
)?
๐ Description
[Description of the bug.]
I build a website based on react + typescript and use magic link as the wallet solution. it works fine when user sign in with email ,but when connect with metamask and try to call magic.rpcProvider.request({ 'eth_signTypedData_v4', params, }),
i got this error - Magic RPC Error: [-32603] Internal error: User denied account access..
๐งฉ Steps to Reproduce
use magic link with metamask and try to sign some data by calling eth_signTypedData_v4
๐ค Expected behavior
magic.rpcProvider.request({ 'eth_signTypedData_v4', params, })
success
[What you expected to happen?]
๐ฎ Actual behavior
[What actually happened? Please include any error stack traces you encounter.]
Magic RPC Error: [-32603] Internal error: User denied account access.
๐ป Code Sample
[If possible, please provide a code repository, gist, code snippet or sample files to reproduce the issue.]
๐ Environment
Software | Version(s) |
---|---|
magic-sdk |
^20.1.1 |
Browser | Chrome |
yarn |
16.13.2 |
Operating System | windows 10 |
Hello @jamesVectorspace, if your user is logging in via 3rd party wallet like Metamask through our connectWithUI
login call, you'll want to grab the provider via this method.
You should only use magic.rpcProvider
if the user is logging in via one of Magic's auth methods, and not 3rd party wallet.
Adding a codesandbox link for further clarification.
https://rgx1gf.csb.app/
@jamesVectorspace if the user is connecting via 3rd party wallet, please make use of our getProvider
SDK method, more info can be found in our docs
@jamesVectorspace is the latest comment in reference to another issue?
If the user has logged into the Magic app via email, which signing modal is not closed after confirming? Could you provide screenshots?
Also, please verify you've created a Universal Wallet app.
After you click sign, another tab should be opening up where you confirm this.
Is that 2nd tab being suppressed in your browser?
yes, i confirmed, so another tab is closed, but above modal is not closed, it needs sign again and again. isnot this bug?
one thing to let you know, when i changed data structure like this, that works well.
const types = {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
License: [
{ name: 'tokenURI', type: 'string' },
{ name: 'artistId', type: 'string' },
{ name: 'creatorListingFormat', type: 'uint256' },
{ name: 'marketPrice', type: 'uint256' },
{ name: 'recommendedPrice', type: 'uint256' },
{ name: 'mediaListingFormat', type: 'uint256' },
{ name: 'exclusivePrice', type: 'uint256' },
{ name: 'nonExclusivePrice', type: 'uint256' },
],
}
So in your app, when you sign message with data structure below, does the experience match the above flow?
const types = {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
License: [
{ name: 'tokenURI', type: 'string' },
{ name: 'artistId', type: 'string' },
{ name: 'creatorListingFormat', type: 'uint256' },
{ name: 'marketPrice', type: 'uint256' },
{ name: 'recommendedPrice', type: 'uint256' },
{ name: 'mediaListingFormat', type: 'uint256' },
{ name: 'exclusivePrice', type: 'uint256' },
{ name: 'nonExclusivePrice', type: 'uint256' },
],
}
And when you use the data structure as shown here, which modal is not closing?
Could you provide a demo app where I can reproduce this or a recorded video of behavior?
Could you try this demo app and let me know if this is what you experience when using the code snippet above?
- After login, scroll down and enter message to sign.
- Start sign, notice new tab, confirm on 2nd tab and it will close.
- You'll return to first tab, and after brief loading, the first modal will also close.