feat: Integration of Discord and Farcaster for Authentication #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces Discord and Farcaster as methods for authentication in our web application, ensuring enhanced security and a streamlined user experience. By leveraging these platforms, we enable single-sign-on capabilities, allowing users to vote securely and ensuring that each user can only vote once. The authentication tokens provided have a lifespan of 30 days, offering users continuous access without frequent logins.
Details of Implementation
@dynamic-labs/sdk-react-core
: Utilized for integrating Farcaster authentication smoothly within our React components..env.example
to includeVITE_DYNAMIC_ENV_ID
to configure the Dynamic environment.NavMenu
and other relevant components.Key File Changes
packages/client/.env.example
: Added environment variable for Dynamic ID.packages/client/package.json
: Introduced@dynamic-labs/sdk-react-core
for handling Farcaster-specific logic.packages/client/src/components/NavMenu.tsx
: Integrated use ofuseDynamicContext
for user authentication status and management.packages/client/src/main.tsx
: Wrapped application root withDynamicContextProvider
to manage environment settings and error debugging.packages/client/src/pages/DailyPoll/DailyPoll.tsx
: Adjusted voting logic to accommodate new authentication methods and ensure secure vote encryption and transmission.