FEATURE: Better UX for anonymous users (#25)

Improves the subscription flow for anonymous users by making the routes available, and showing a login button. Clicking login from this page will save a `destination_url` cookie so that when logging in they're redirected back to the subscription page they were at.
This commit is contained in:
Justin DiRose
2020-10-28 13:30:26 -05:00
committed by GitHub
parent 8ffe769ca9
commit 1ad5b17640
11 changed files with 55 additions and 33 deletions
@@ -1,41 +1,41 @@
export default function(helpers) {
export default function (helpers) {
const { response } = helpers;
this.get("/s/products", () => {
this.get("/s", () => {
const products = [
{
id: "prod_23o8I7tU4g56",
name: "Awesome Product",
description:
"Subscribe to our awesome product. For only $230.10 per month, you can get access. This is a test site. No real credit card transactions."
"Subscribe to our awesome product. For only $230.10 per month, you can get access. This is a test site. No real credit card transactions.",
},
{
id: "prod_B23dc9I7tU4eCy",
name: "Special Product",
description:
"This is another subscription product. You can have more than one. From $12 per month."
}
"This is another subscription product. You can have more than one. From $12 per month.",
},
];
return response(products);
});
this.get("/s/products/:id", () => {
const product = {};
return response(product);
});
this.get("/s/plans", () => {
this.get("/s/:id", () => {
const product = {
id: "prod_23o8I7tU4g56",
name: "Awesome Product",
description:
"Subscribe to our awesome product. For only $230.10 per month, you can get access. This is a test site. No real credit card transactions.",
};
const plans = [
{
id: "plan_GHGHSHS8654G",
amount: 200,
currency: "usd",
interval: "month"
}
interval: "month",
},
];
return response(plans);
return response({ product, plans });
});
}