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

Read query parameters (key, sigAlgo and source) from URL #40

Merged
merged 2 commits into from Mar 15, 2022

Conversation

muttoni
Copy link
Contributor

@muttoni muttoni commented Mar 3, 2022

Closes #38

Description

The Create Account flow now automatically prefills publicKey and sigAlgo with the following query URL parameters:

It also supports an extra source parameter, which can be used to identify the traffic source (e.g. kittyitems). This information is included as an additional property in the "Faucet: Create Account" mixplanel event.

DISCLAIMER: I am not very familiar with the Typescript/React/Next.js stack, so apologies if this is not idiomatic or is not adhering to Next.js best practices. After exploring a couple options, I used getInitialProps to read the query params and provide context to the page as props. I previously tried a simple client-side solution using next/router directly in the form component but it was not prefilling correctly since it was being pre-rendered on the server without re-hydrating.

DISCLAIMER #2: I was not able to get docker running, so I limited my testing to the frontend -- it appears to work fine (parameters can be empty, a nonexistent sigAlgo defaults to ECDSA, etc), but can someone can please E2E test this before merging just in case? (e.g. check creation success, mixpanel events, etc)


  • Targeted PR against main branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@vercel
Copy link

vercel bot commented Mar 3, 2022

@muttoni is attempting to deploy a commit to the Flow Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Mar 10, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

flow-faucet-canarynet – ./

🔍 Inspect: https://vercel.com/onflow/flow-faucet-canarynet/EnYQHTgGuD1XfFJed78AgnGcADeo
✅ Preview: https://flow-faucet-canarynet-git-fork-muttoni-autofill-onflow.vercel.app

flow-faucet-testnet – ./

🔍 Inspect: https://vercel.com/onflow/flow-faucet-testnet/AcQro2AqWMtreFvdoECoXqak3Ca6
✅ Preview: Failed

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.

Query parameters for passing values
2 participants