Skip to main content

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.
Works with
JavaScript / TypeScriptNext.jsExpress
Stack
Next.js storefront, Express orders API

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​

WhoRole in the applicationIdentity in LumoAuth
ShopperBuys.A user created by the first magic link.
Marketing toolsReceive events.An analytics destination and a webhook.

Flows​

FlowWhat happensWhat LumoAuth does
CheckoutThe shopper types an email address.Sends a magic link in the shop's own template.
ReturnThe shopper comes back.Offers a passkey, so the next visit needs no email.
ProfileThe second sign-in asks one question.Stores the answer as a trait.
RiskA sign-in from a new device and country.Asks for a second factor this time only.
AbuseA script requests links for many addresses.Requires a CAPTCHA, then limits the rate.
EventsA sign-up happens.Sends user.created to the webhook and to analytics.

Parts​

PartBuilt withJob
StorefrontNext.js, @lumoauth/nextjsCatalogue, basket, the email-first card.
Orders APIExpressOrders, 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​

  1. Check out as a guest.
  2. Open the link, and read the order.
  3. Sign in again, and answer the profile question.
  4. Run the abuse script against a sandbox.

Before you run it​

  • Check that your plan includes adaptive MFA in the plans matrix.