diff --git a/apps/marketing/src/app/(marketing)/claimed/page.tsx b/apps/marketing/src/app/(marketing)/claimed/page.tsx
index 90e7a9843..f709e46e7 100644
--- a/apps/marketing/src/app/(marketing)/claimed/page.tsx
+++ b/apps/marketing/src/app/(marketing)/claimed/page.tsx
@@ -32,10 +32,21 @@ export default async function ClaimedPlanPage({ searchParams = {} }: ClaimedPlan
}
const session = await stripe.checkout.sessions.retrieve(sessionId);
+ const customerId = typeof session.customer === 'string' ? session.customer : session.customer?.id;
+
+ if (!customerId) {
+ redirect('/');
+ }
+
+ const customer = await stripe.customers.retrieve(customerId);
+
+ if (!customer || customer.deleted) {
+ redirect('/');
+ }
const user = await prisma.user.findFirst({
where: {
- id: Number(session.client_reference_id),
+ id: Number(customer.metadata.userId),
},
});
diff --git a/apps/marketing/src/app/(marketing)/pricing/page.tsx b/apps/marketing/src/app/(marketing)/pricing/page.tsx
index c1f8299f3..f6c4a63ca 100644
--- a/apps/marketing/src/app/(marketing)/pricing/page.tsx
+++ b/apps/marketing/src/app/(marketing)/pricing/page.tsx
@@ -6,6 +6,7 @@ import {
AccordionItem,
AccordionTrigger,
} from '@documenso/ui/primitives/accordion';
+import { Button } from '@documenso/ui/primitives/button';
import { PricingTable } from '~/components/(marketing)/pricing-table';
@@ -34,6 +35,26 @@ export default function PricingPage() {
+ Our self-hosted option is great for small teams and individuals who need a simple + solution. You can use our docker based setup to get started in minutes. Take control with + full customizability and data ownership. +
+ +Self Hosted
-Free
+Free Plan
+$0
- For small teams and individuals who need a simple solution + For small teams and individuals with basic needs.
- event('view-github')} - > - - +Host your own instance
-Full Control
-Customizability
-Docker Ready
-Community Support
-Free, Forever
+5 standard documents per month
+Up to 10 recipients per document
+No credit card required
diff --git a/apps/marketing/src/pages/api/claim-plan/index.ts b/apps/marketing/src/pages/api/claim-plan/index.ts
index 057485f35..b2fd41727 100644
--- a/apps/marketing/src/pages/api/claim-plan/index.ts
+++ b/apps/marketing/src/pages/api/claim-plan/index.ts
@@ -2,7 +2,7 @@ import { NextApiRequest, NextApiResponse } from 'next';
import { randomUUID } from 'crypto';
-import { hashSync } from '@documenso/lib/server-only/auth/hash';
+import { TEarlyAdopterCheckoutMetadataSchema } from '@documenso/ee/server-only/stripe/webhook/early-adopter-checkout-metadata';
import { redis } from '@documenso/lib/server-only/redis';
import { stripe } from '@documenso/lib/server-only/stripe';
import { prisma } from '@documenso/prisma';
@@ -36,64 +36,38 @@ export default async function handler(
where: {
email: email.toLowerCase(),
},
- include: {
- Subscription: true,
- },
});
- if (user && user.Subscription) {
+ if (user) {
return res.status(200).json({
redirectUrl: `${process.env.NEXT_PUBLIC_WEBAPP_URL}/login`,
});
}
- const password = Math.random().toString(36).slice(2, 9);
- const passwordHash = hashSync(password);
-
- const { id: userId } = await prisma.user.upsert({
- where: {
- email: email.toLowerCase(),
- },
- create: {
- email: email.toLowerCase(),
- name,
- password: passwordHash,
- },
- update: {
- name,
- password: passwordHash,
- },
- });
-
- await redis.set(`user:${userId}:temp-password`, password, {
- // expire in 24 hours
- ex: 60 * 60 * 24,
- });
-
- const signatureDataUrlKey = randomUUID();
+ const clientReferenceId = randomUUID();
if (signatureDataUrl) {
- await redis.set(`signature:${signatureDataUrlKey}`, signatureDataUrl, {
+ await redis.set(`signature:${clientReferenceId}`, signatureDataUrl, {
// expire in 7 days
ex: 60 * 60 * 24 * 7,
});
}
- const metadata: Record