Existing Authentication System - Existing Customer
Last updated
Last updated
For existing customers, the best practice is to minimize the friction of augmented the user account with blockchain capability. The best approach would be to create a button that triggers the login process with the user’s email address inferred in the request. We’d suggest two options:
A button on an account page that calls the same passport.login method that is called above:
In this situation, the webpage should already be aware of the email address, so emailValue can be easily populated and the passport Object will automatically trigger the passworldless authentication workflow.
Also, an email can be sent to existing users touting the benefits of the program, and offering a link to register. The link can embed the email address and the receiving URL can process the link and trigger the registration/login workflow. For example, you could put a link in the email that redirects to and includes the user’s address.
Unfortunately, the link cannot be pre-emptive as our links only stay active for 10 minutes and need to be spawned by a browser running a Passport object to receive notification of confirmed login. In the example below, this code runs on a Passport-enabled page and pulls the email address from the querystring (we’d recommend encrypting and decrypting, but for simplicity, we skip that step).
Note that if a user clicks this after they have already registered, the experience will be the same (although the link does expire after 10 minutes).
So would take you to a page where the workflow is triggered and, upon confirmation of login check, redirects you to a success page where you can welcome the user and provide some additional information (or maybe collect some additional information).