Read query parameters (key, sigAlgo and source) from URL #40
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.
Closes #38
Description
The Create Account flow now automatically prefills
publicKey
andsigAlgo
with the following query URL parameters:key
: the public key (as per issue Query parameters for passing values #38)sig-algo
: the signature algorithm (as per issue Query parameters for passing values #38), defaulting toECDSA_P256
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)
main
branchFiles changed
in the Github PR explorer