Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

small edits based on user feedback

Steven Tey48ab9d2743d7
diff --git a/components/app/modals/edit-domain-modal.tsx b/components/app/modals/edit-domain-modal.tsx
index 48b56262e7..317061d187 100644
--- a/components/app/modals/edit-domain-modal.tsx
+++ b/components/app/modals/edit-domain-modal.tsx
@@ -175,14 +175,18 @@ function EditDomainModal({
className="block text-sm text-gray-700"
>
To verify, type{" "}
- <span className="font-semibold">confirm domain change</span> below
+ <span className="font-semibold text-red-600">
+ yes, change my domain
+ </span>{" "}
+ below
</label>
<div className="relative mt-1 rounded-md shadow-sm">
<input
type="text"
name="verification"
id="verification"
- pattern="confirm domain change"
+ pattern="yes, change my domain"
+ placeholder="yes, change my domain"
required
autoFocus={false}
className="border-gray-300 text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:ring-gray-500 pr-10 block w-full rounded-md focus:outline-none sm:text-sm"
diff --git a/pages/api/stripe/upgrade.ts b/pages/api/stripe/upgrade.ts
index 56f43b530e..824e833243 100644
--- a/pages/api/stripe/upgrade.ts
+++ b/pages/api/stripe/upgrade.ts
@@ -1,13 +1,20 @@
import { NextApiRequest, NextApiResponse } from "next";
import { withUserAuth } from "@/lib/auth";
import { stripe } from "@/lib/stripe";
+import { UserProps } from "@/lib/types";
export default withUserAuth(
- async (req: NextApiRequest, res: NextApiResponse, userId) => {
+ async (
+ req: NextApiRequest,
+ res: NextApiResponse,
+ userId: string,
+ user: UserProps
+ ) => {
// POST /api/stripe/upgrade – upgrade a user's account from free to pro
if (req.method === "POST") {
const { priceId } = req.query as { priceId: string };
const session = await stripe.checkout.sessions.create({
+ customer_email: user.email,
payment_method_types: ["card"],
billing_address_collection: "required",
success_url: `${
@@ -31,5 +38,6 @@ export default withUserAuth(
.status(405)
.json({ error: `Method ${req.method} Not Allowed` });
}
- }
+ },
+ { needUserDetails: true }
);
diff --git a/pages/api/stripe/webhook.ts b/pages/api/stripe/webhook.ts
index 588af0b82d..c72312c3f2 100644
--- a/pages/api/stripe/webhook.ts
+++ b/pages/api/stripe/webhook.ts
@@ -22,7 +22,6 @@ async function buffer(readable: Readable) {
const relevantEvents = new Set([
"checkout.session.completed",
- "invoice.payment_failed",
"customer.subscription.updated",
"customer.subscription.deleted",
]);