[bug] Error preparing message, please retry!
Is there an existing issue for this?
- [X] I have searched the existing issues
RainbowKit Version
0.8.1
wagmi Version
0.10.10
Current Behavior
Hey, I just installed Rainbowkit and tried to make the authentication process work. But, unfortunately, I can't sign in with Ethereum because I get the error "Error preparing message, please retry!".
Here is a screenshot
Expected Behavior
To generate the message successfully.
Steps To Reproduce
No response
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
It's probably my fault since I am a noob, but I would highly appreciate some help. ✌️
Hey @nickolastazes. I think your issue is that you're missing the NEXTAUTH_SECRET env variable. Create a new .env.local with a generated secret and check back here if the problem persists.
Reference the example here: https://github.com/rainbow-me/rainbowkit/blob/01f61336fcc252ef4475987b1b65d5dabee690c8/examples/with-next-siwe-next-auth/.env.local.example#L1
Gm @DanielSinclair, the problem is already fixed. Thank you for your time and help!
@nickolastazes how did you solve it?
i am getting the same error and i tried the solution suggested by @DanielSinclair but it did not worked for me, how did you fix it @nickolastazes
Never mind, i fixed it myself, the problem wasn't in my app.js/ts but it was in api/auth/[...nextauth], and in the env, what happened in my case was i thought i only needed to setup app.js/ts not the other file inside api folder along with the env correctly setup them by following the example provided by team rainbow solved the problem
Exactly @shishirtiwari23, the issue is the nextauth file. However, the provided file in the example didn't work for me, so I had to tweak it myself.
@nickolastazes Can you share your implementation please?
@nickolastazes same here, can you share your tweaks?
@VampishWolf @mpaler if you web3 wallet based auth, i would highly recommend using thirdweb's wallet service which does the same perhaps opensea's, because there are major bugs in rainbow kit's version, and those bugs are so critical that a user might be able access something that he shouldn't, like when we switch wallet rainbow kit does not automatically detects that there is a wallet change instead you would have to write that mechanism yourself
@shishirtiwari23
- RainbowKit's Auth API is built on top of the
siwelibrary with the help of Spruce. It's safe and secure, and simply relies on a wallet signing a message for the dApp. We'd have bigger problems in this industry if there was a vulnerability in wallet signatures 😅 - What do you mean by "switch wallet"? Can look into improving the API if we're missing anything