Sundry
A shop in which a guest checks out with a link by email, becomes a customer without a form, and is asked for a second factor only when a sign-in looks risky.
ApplicationPlanned
This example is planned. Not built yet. This page is the specification for the example.
Scenario
A visitor puts a kettle in the basket and types an email address at checkout. A link arrives, and the order is theirs. At the second visit the shop asks for a name, at the third for a phone number. A sign-in from a new country asks for a code. A script that tries a thousand addresses meets a CAPTCHA and a rate limit.
People and agents
| Who | Role in the application | Identity in LumoAuth |
|---|---|---|
| Shopper | Buys. | A user created by the first magic link. |
| Marketing tools | Receive events. | An analytics destination and a webhook. |
Flows
| Flow | What happens | What LumoAuth does |
|---|---|---|
| Checkout | The shopper types an email address. | Sends a magic link in the shop's own template. |
| Return | The shopper comes back. | Offers a passkey, so the next visit needs no email. |
| Profile | The second sign-in asks one question. | Stores the answer as a trait. |
| Risk | A sign-in from a new device and country. | Asks for a second factor this time only. |
| Abuse | A script requests links for many addresses. | Requires a CAPTCHA, then limits the rate. |
| Events | A sign-up happens. | Sends user.created to the webhook and to analytics. |
Parts
| Part | Built with | Job |
|---|---|---|
| Storefront | Next.js, @lumoauth/nextjs | Catalogue, basket, the email-first card. |
| Orders API | Express | Orders, and the webhook receiver. |
What the seed script creates
- Magic links and one social provider turned on.
- Traits and two profile steps.
- A risk policy.
- A CAPTCHA provider.
- An email template.
- A webhook.
Walkthrough
- Check out as a guest.
- Open the link, and read the order.
- Sign in again, and answer the profile question.
- Run the abuse script against a sandbox.
Before you run it
- Check that your plan includes adaptive MFA in the plans matrix.