Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] RainbowKitSiweNextAuthProvider not working with NextAuth.js v5 #1682

Open
1 task done
edxeth opened this issue Jan 3, 2024 · 13 comments
Open
1 task done

[bug] RainbowKitSiweNextAuthProvider not working with NextAuth.js v5 #1682

edxeth opened this issue Jan 3, 2024 · 13 comments

Comments

@edxeth
Copy link

edxeth commented Jan 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

1.3.2

wagmi Version

1.4.12

Current Behavior

I'm thrown a runtime error when I try to use RainbowKitSiweNextAuthProvider with NextAuth.js v5:

image

The issue has appeared upon migration to v5. (it worked on v4)
Unwrapping RainbowKitProvider from RainbowKitSiweNextAuthProvider resolves the issue even though I'm not able to leverage Sign-in with Ethereum (siwe) then.

@components/RainbowKit.tsx:

image

@/app/layout.tsx:

image

My dependencies:

  • @rainbow-me/rainbowkit: 1.3.2
  • @rainbow-me/rainbowkit-siwe-next-auth: 0.3.4
  • next-auth: 5.0.0-beta.4
  • siwe: 2.1.4
  • viem: 1.21.3
  • wagmi: 1.4.12

Expected Behavior

No response

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

@c0rdeiro
Copy link

c0rdeiro commented Jan 4, 2024

I think it is not compatible with next-auth v5 yet
https://github.com/rainbow-me/rainbowkit/releases/tag/%40rainbow-me%2Frainbowkit-siwe-next-auth%400.3.3

@DanielSinclair
Copy link
Collaborator

@edxeth Currently the peer version is not supported and you should receive a package manager warning. Feel free to ping here when next-auth v5 is out of beta, and we can work on adding support!

@edxeth
Copy link
Author

edxeth commented Jan 4, 2024

@c0rdeiro I see, thanks for the reference!

@DanielSinclair I will, looking forward to that :)

PS: out of curiosity, wagmi v2 and viem v2 were released so when can we expect RainbowKit to support the new version?

@magiziz
Copy link
Contributor

magiziz commented Jan 24, 2024

@edxeth The wagmi v2 and viem v2 support will be released very soon, but we do have a beta version that you can try out. Feel free to look at the migration guide here: https://beta.rainbowkit.com/guides/rainbowkit-wagmi-v2

Let me know if you find any issues 👍

@KeeganEad
Copy link

@kosmoskey with that will the rainbowkit-siwe-next-auth dependency be upgraded to [email protected] ?

@magiziz
Copy link
Contributor

magiziz commented Feb 10, 2024

@kosmoskey with that will the rainbowkit-siwe-next-auth dependency be upgraded to [email protected] ?

Yes that's correct. RainbowKit will be upgraded to 2.x. Just make sure to update @rainbow-me/rainbowkit-siwe-next-auth to the latest version 0.4.x once it's out.

@magiziz
Copy link
Contributor

magiziz commented Feb 14, 2024

@edxeth Are you still facing this issue ? If yes do you have a small code example i can look at ?

@edxeth
Copy link
Author

edxeth commented Feb 14, 2024

@kosmoskey is Rainbowkit v2 now supporting Next-Auth v5 (still in beta)?

@magiziz
Copy link
Contributor

magiziz commented Feb 15, 2024

@kosmoskey is Rainbowkit v2 now supporting Next-Auth v5 (still in beta)?

We don't support beta yet. Are you able to use the latest non beta version for now and when the v5 launches we'll make sure to update it with RainbowKit.

@DanielSinclair
Copy link
Collaborator

Auth.js seems to be approaching a production release of v5 soon, so we will begin working on this. We are also evaluating other improvements to the Authentication/SIWE flow. Do you use SIWE alongside other auth methods in your next-auth configuration, or would you prefer if most of the boilerplate implementation is handled within RainbowKit's adapter package? I think we have the opportunity to make this much simpler for devs! Feedback or ideas are appreciated.

@c0rdeiro
Copy link

@DanielSinclair Although next auth does require a significant amount of boilerplate I think the priority should move away from siwe lib since it requires ethers still
I see you're working here #1997 on moving to the new viem siwe which already makes me very happy. Keep up the great work

@EF09FE
Copy link

EF09FE commented Nov 2, 2024

any updates?

@c0rdeiro
Copy link

c0rdeiro commented Nov 4, 2024

@EF09FE check the version 2.2.0 release notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants