generated from thirdweb-example/next-starter
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
We need to implement Sign-In with Ethereum (SIWE) authentication in our application to manage user access based on their ownership of specific NFTs (Creator Pass or Free Fan Pass).
Objectives:
- Implement SIWE authentication flow
- Verify user's NFT ownership (Creator Pass or Free Fan Pass)
- Restrict access to upload functionality to Creator Pass holders
- Allow viewing and buying content for both Creator Pass and Free Fan Pass holders
Technical Requirements:
-
SIWE Integration:
- Implement SIWE authentication using ethers.js and siwe npm package
- Create a sign-in page/modal for users to connect their wallet and sign the SIWE message
- Implement session management to maintain user authentication state
-
NFT Verification:
- After successful SIWE authentication, query the blockchain to verify if the user owns a Creator Pass (https://polygonscan.com/address/0xb6b645c3e2025cf69983983266d16a0aa323e2b0) or Free Fan Pass (https://polygonscan.com/address/0xe174caa294999ec622988242641a27c11e6c22d8) NFT
- Store the user's pass type (Creator/Fan) in the session
-
Access Control:
- Modify the Upload component to check for Creator Pass ownership before allowing access
- Implement middleware or route guards to restrict access to upload functionality
- Allow viewing and buying content for both Creator Pass and Free Fan Pass holders
-
UI/UX Updates:
- Create a user profile section displaying the user's connected address and pass type
- Update navigation to show/hide options based on the user's authentication status and pass type
- Implement a sign-out functionality
-
Error Handling and Edge Cases:
- Handle cases where users don't have the required NFTs
- Implement proper error messages and redirects for unauthorized access attempts
Acceptance Criteria:
- Users can successfully authenticate using SIWE
- Creator Pass holders can access the upload functionality
- Both Creator Pass and Free Fan Pass holders can view, upload and buy content
- Users without the required NFTs are restricted from accessing certain features
- The UI clearly indicates the user's authentication status and pass type
- Users can sign out of the application
Additional Notes:
- Consider implementing a caching mechanism to reduce frequent blockchain queries for NFT ownership verification
- Ensure the implementation follows best practices for Web3 authentication and security
- Update the application's documentation to reflect the new authentication flow
This also includes tying OrbisDB into the SIWE Auth flow.
Resources:
- Thirdweb SIWE documentation: https://portal.thirdweb.com/connect/auth
- Unlock Protocol SIWE documentation: https://docs.unlock-protocol.com/tools/sign-in-with-ethereum/
- Livepeer token gated interaction (Webhooks): https://docs.livepeer.org/developers/guides/access-control-webhooks
- Livepeer token gated interaction (JWT): https://docs.livepeer.org/developers/guides/access-control-jwt
- OrbisDB Discord: https://discord.com/channels/1047426066370789417/1049239601908285460/1303357846175617036
- Livepeer Support: https://discord.com/channels/423160867534929930/1305824736668024852
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed