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

Gating dApp #767

Merged
merged 22 commits into from
Oct 28, 2024
Merged

Gating dApp #767

merged 22 commits into from
Oct 28, 2024

Conversation

kkosiorowska
Copy link
Contributor

@kkosiorowska kkosiorowska commented Oct 16, 2024

This PR introduces a gating in dApp. The user must enter access code to access a standalone dApp. The access code entered on the form is checked by a special endpoint access/verify. When the code is correct, the dApp should allow the user to see dApp. Otherwise, we will show the right error message.

What has been done

  • Added VITE_FEATURE_GATING_DAPP_ENABLED feature flag
  • Added modal window for gating dApp
  • User access code verification
  • Created password form
  • Saved encoded access code in localStorage

UI

Screen.Recording.2024-10-22.at.13.09.04.mov

@kkosiorowska kkosiorowska self-assigned this Oct 16, 2024
Copy link

netlify bot commented Oct 16, 2024

Deploy Preview for acre-dapp ready!

Name Link
🔨 Latest commit 9d9c120
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp/deploys/671a54c5b8bfc400088151a9
😎 Deploy Preview https://deploy-preview-767--acre-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 16, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 9d9c120
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/671a54c55180440008da9294
😎 Deploy Preview https://deploy-preview-767--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kkosiorowska kkosiorowska force-pushed the gating-dapp-ui branch 2 times, most recently from 7e94893 to b50442d Compare October 22, 2024 09:22
@kkosiorowska kkosiorowska changed the base branch from main to ledger-live-updates October 22, 2024 09:23
@kkosiorowska kkosiorowska marked this pull request as ready for review October 22, 2024 12:04
@kkosiorowska kkosiorowska changed the base branch from ledger-live-updates to main October 22, 2024 12:36
dapp/src/components/shared/Form/FormInput.tsx Outdated Show resolved Hide resolved
dapp/src/hooks/useGatingDApp.ts Outdated Show resolved Hide resolved
dapp/src/utils/acreApi.ts Outdated Show resolved Hide resolved
dapp/src/hooks/useGatingDApp.ts Outdated Show resolved Hide resolved
import useLocalStorage from "./useLocalStorage"

export default function useAccessCode() {
const [accessCode, setAccessCode] = useLocalStorage<string | undefined>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [accessCode, setAccessCode] = useLocalStorage<string | undefined>(
const [encodedCode, setAccessCode] = useLocalStorage<string | undefined>(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r-czajkowski
r-czajkowski previously approved these changes Oct 24, 2024
@r-czajkowski r-czajkowski merged commit a86949e into main Oct 28, 2024
28 checks passed
@r-czajkowski r-czajkowski deleted the gating-dapp-ui branch October 28, 2024 11:01
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

Successfully merging this pull request may close these issues.

3 participants