-
f02bced: The Authentication API now supports ERC-1271 and ERC-6492 for smart contract signature verification to enable Sign-in with Ethereum for Smart Contract Wallets.
We have also deprecated the
siwe
andethers
peer dependencies in favor ofviem/siwe
.Follow the appropriate steps below to migrate.
- Remove
siwe
andethers
npm uninstall siwe ethers
- Upgrade RainbowKit,
rainbowkit-siwe-next-auth
, andviem
npm i @rainbow-me/rainbowkit@^2.2.0 rainbow-me/rainbowkit-siwe-next-auth@^0.5.0 viem@^2.12.0
- Create a Public Client
This allows
viem
to verify smart contract signatures.const config = getDefaultConfig({ /* your config */ }); + const publicClient = config.getClient().extend(publicActions);
- Adjust your
authorize
implementation in/api/auth/[...nextauth].ts
- import { SiweMessage } from 'siwe'; + import { + type SiweMessage, + parseSiweMessage, + validateSiweMessage, + } from 'viem/siwe'; export function getAuthOptions(req: IncomingMessage): NextAuthOptions { const providers = [ CredentialsProvider({ async authorize(credentials: any) { - const siwe = new SiweMessage( - JSON.parse(credentials?.message || '{}'), - ); + const siweMessage = parseSiweMessage( + credentials?.message, + ) as SiweMessage; + if (!validateSiweMessage({ + address: siweMessage?.address, + message: siweMessage, + })) { + return null; + } /* ... */ - await siwe.verify({ signature: credentials?.signature || '' }); + const valid = await publicClient.verifyMessage({ + address: siweMessage?.address, + message: credentials?.message, + signature: credentials?.signature, + }); + if (!valid) { + return null; + } }, /* ... */ }) ] }
Reference the with-next-siwe-next-auth example for more guidance.
- Remove
- Updated dependencies [f02bced]
- @rainbow-me/[email protected]
- Updated dependencies [90d6931]
- Updated dependencies [82153ed]
- @rainbow-me/[email protected]
-
aa0269e: RainbowKit has reached v2 alongside wagmi, which includes breaking changes.
0.4.x
now requires@rainbow-me/rainbowkit
v2, specifically:2.x.x
.
-
Peer dependency support for RainbowKit
1.3.x
-
Updated dependencies [9ce75a65]
- @rainbow-me/[email protected]
- 2f56ab23: Adopted
'use client'
directive for safe App Router usage - 9dfe0531: Added strict peer incompatibility with
next-auth@5
. RainbowKit will supportnext-auth
v5 in a future release with improved App Router support.
- Updated dependencies [ef64a229]
- @rainbow-me/[email protected]
-
Peer dependency support for RainbowKit
1.1.x
-
Updated dependencies [b37f5d68]
- @rainbow-me/[email protected]
-
86be3f0: Support for
next-auth
versions4.21.0
and above.Migration guide
-
Upgrade
next-auth
to~4.22.0
-
In your
next-auth
providersasync authorize(credentials)
implementation, alter the parameters passed togetCsrfToken
like so. Reference our example implementation here.
- const nonce = await getCsrfToken({ req }); + const nonce = await getCsrfToken({ req: { headers: req.headers } });
-
-
93b58d0: RainbowKit has reached v1 alongside wagmi, which includes breaking changes.
0.2.x
now requires@rainbow-me/rainbowkit
v1, specifically:1.0.x
.While wagmi v1 now relies on
viem
instead of theethers
peer dependency,siwe
will still requireethers
as a peer dependency. Ensure that you have installed a compatibleethers
version, including:^5.6.8 || ^6.0.8
.
-
865175f: Upgraded minimum
siwe
peer dependency to^2.1.4
and minimumethers
peer dependency to^5.6.8
to resolvesiwe
peer mismatch.Specified maximum
next-auth
peer dependency as4.20.1
due to known issues introduced in later versions.Updated Authentication docs and examples to support modern
next-auth
types.
- 532b117: Fixed an issue with peer dependencies versioning
- Updated dependencies [1876ba0]
- @rainbow-me/[email protected]
- Updated dependencies [355402b]
- @rainbow-me/[email protected]
- Updated dependencies [49f0ec9]
- @rainbow-me/[email protected]
- 6b37050: Added
@rainbow-me/[email protected]
as a peer dependency
- 2e6bb8f: Include
v0.7.x
in RainbowKit peer dependency range
- 62fd332: Include RainbowKit v0.6.x in peer dependency range
- Updated dependencies [12912b3]
- Updated dependencies [fcfc13d]
- Updated dependencies [3f9013f]
- @rainbow-me/[email protected]
- Updated dependencies [8060ccd]
- Updated dependencies [4dfe834]
- Updated dependencies [8060ccd]
- @rainbow-me/[email protected]
- 737a1d6: Initial release.
- Updated dependencies [737a1d6]
- Updated dependencies [488c5a1]
- @rainbow-me/[email protected]