Replace the existing Supabase Auth flow with a Coinbase Smart Wallet integration and SIWE implementation. The Smart Wallet integration should be completed using one of the following options:
Since we currently use the Thirdweb SDK, we could follow the migration guide to upgrade and make use of their CB Smart Wallet integration. Alternatively we could use Web3Modal with Wagmi, or use Wagmi directly. All of these options are included in the smartwallet.dev docs, but the wagmi integration is the most well documented.
Requirements
Use one of the integration options above or propose a suitable alternative.
Allow user to connect with an existing CB smart wallet or create a new one.
Use SIWE to authenticate the user and update the session.
Use session info in app for authorization, e.g. to restrict read/write access to resources in Mesa.
Additional Considerations
We currently use Supabase Auth for password-less email-based authentication. With the move to CB Smart wallets, we will either need to move away from RLS or include a custom JWT and and corresponding database functions to replace those provided by Supabase auth. I can share my experience using SIWE with Supabase and RLS if we choose that route.
Our code includes a compatibility shim for ethers that will no longer be needed after this change and can be removed.
Overview
Replace the existing Supabase Auth flow with a Coinbase Smart Wallet integration and SIWE implementation. The Smart Wallet integration should be completed using one of the following options:
Since we currently use the Thirdweb SDK, we could follow the migration guide to upgrade and make use of their CB Smart Wallet integration. Alternatively we could use Web3Modal with Wagmi, or use Wagmi directly. All of these options are included in the smartwallet.dev docs, but the wagmi integration is the most well documented.
Requirements
Additional Considerations
We currently use Supabase Auth for password-less email-based authentication. With the move to CB Smart wallets, we will either need to move away from RLS or include a custom JWT and and corresponding database functions to replace those provided by Supabase auth. I can share my experience using SIWE with Supabase and RLS if we choose that route.
Our code includes a compatibility shim for
ethers
that will no longer be needed after this change and can be removed.