diff --git a/.env.example b/.env.example index 6a81f72e2..4919f0053 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,10 @@ NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="DEADBEEF" NEXT_PRIVATE_GOOGLE_CLIENT_ID="" NEXT_PRIVATE_GOOGLE_CLIENT_SECRET="" +NEXT_PRIVATE_OIDC_WELL_KNOWN="" +NEXT_PRIVATE_OIDC_CLIENT_ID="" +NEXT_PRIVATE_OIDC_CLIENT_SECRET="" + # [[URLS]] NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000" NEXT_PUBLIC_MARKETING_URL="http://localhost:3001" diff --git a/apps/marketing/src/pages/api/stripe/webhook/index.ts b/apps/marketing/src/pages/api/stripe/webhook/index.ts index a19cffda9..fa8cb60e4 100644 --- a/apps/marketing/src/pages/api/stripe/webhook/index.ts +++ b/apps/marketing/src/pages/api/stripe/webhook/index.ts @@ -13,6 +13,7 @@ import { updateFile } from '@documenso/lib/universal/upload/update-file'; import { prisma } from '@documenso/prisma'; import { DocumentDataType, + DocumentSource, DocumentStatus, FieldType, ReadStatus, @@ -104,6 +105,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const document = await prisma.document.create({ data: { + source: DocumentSource.DOCUMENT, title: 'Documenso Supporter Pledge.pdf', status: DocumentStatus.COMPLETED, userId: user.id, diff --git a/apps/web/process-env.d.ts b/apps/web/process-env.d.ts index 0c00cb4c1..63a341060 100644 --- a/apps/web/process-env.d.ts +++ b/apps/web/process-env.d.ts @@ -12,5 +12,9 @@ declare namespace NodeJS { NEXT_PRIVATE_GOOGLE_CLIENT_ID: string; NEXT_PRIVATE_GOOGLE_CLIENT_SECRET: string; + + NEXT_PRIVATE_OIDC_WELL_KNOWN: string; + NEXT_PRIVATE_OIDC_CLIENT_ID: string; + NEXT_PRIVATE_OIDC_CLIENT_SECRET: string; } } diff --git a/apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx b/apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx index 21be26129..b95bb9a73 100644 --- a/apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx +++ b/apps/web/src/app/(dashboard)/templates/[id]/edit-template.tsx @@ -256,6 +256,7 @@ export const EditTemplateForm = ({ documentFlow={documentFlow.signers} recipients={recipients} fields={fields} + templateDirectLink={template.directLink} onSubmit={onAddTemplatePlaceholderFormSubmit} isEnterprise={isEnterprise} isDocumentPdfLoaded={isDocumentPdfLoaded} diff --git a/apps/web/src/app/(dashboard)/templates/[id]/template-direct-link-dialog-wrapper.tsx b/apps/web/src/app/(dashboard)/templates/[id]/template-direct-link-dialog-wrapper.tsx new file mode 100644 index 000000000..39d057248 --- /dev/null +++ b/apps/web/src/app/(dashboard)/templates/[id]/template-direct-link-dialog-wrapper.tsx @@ -0,0 +1,40 @@ +'use client'; + +import React, { useState } from 'react'; + +import { LinkIcon } from 'lucide-react'; + +import type { Recipient, Template, TemplateDirectLink } from '@documenso/prisma/client'; +import { Button } from '@documenso/ui/primitives/button'; + +import { TemplateDirectLinkDialog } from '../template-direct-link-dialog'; + +export type TemplatePageViewProps = { + template: Template & { directLink?: TemplateDirectLink | null; Recipient: Recipient[] }; +}; + +export const TemplateDirectLinkDialogWrapper = ({ template }: TemplatePageViewProps) => { + const [isTemplateDirectLinkOpen, setTemplateDirectLinkOpen] = useState(false); + + return ( +
+ Public templates are connected to your public profile. Any modifications + to public templates will also appear in your public profile. +
++ Direct link templates contain one dynamic recipient placeholder. Anyone + with access to this link can sign the document, and it will then appear on + your documents page. +
++ {teamId + ? 'Team only templates are not linked anywhere and are visible only to your team.' + : 'Private templates can only be modified and viewed by you.'} +
+Welcome back, we are lucky to have you.
-
diff --git a/apps/web/src/app/(unauthenticated)/signup/page.tsx b/apps/web/src/app/(unauthenticated)/signup/page.tsx
index c7284fac6..2373af770 100644
--- a/apps/web/src/app/(unauthenticated)/signup/page.tsx
+++ b/apps/web/src/app/(unauthenticated)/signup/page.tsx
@@ -3,7 +3,7 @@ import { redirect } from 'next/navigation';
import { env } from 'next-runtime-env';
-import { IS_GOOGLE_SSO_ENABLED } from '@documenso/lib/constants/auth';
+import { IS_GOOGLE_SSO_ENABLED, IS_OIDC_SSO_ENABLED } from '@documenso/lib/constants/auth';
import { decryptSecondaryData } from '@documenso/lib/server-only/crypto/decrypt';
import { SignUpFormV2 } from '~/components/forms/v2/signup';
@@ -37,6 +37,7 @@ export default function SignUpPage({ searchParams }: SignUpPageProps) {
className="w-screen max-w-screen-2xl px-4 md:px-16 lg:-my-16"
initialEmail={email || undefined}
isGoogleSSOEnabled={IS_GOOGLE_SSO_ENABLED}
+ isOIDCSSOEnabled={IS_OIDC_SSO_ENABLED}
/>
);
}
diff --git a/apps/web/src/components/formatter/template-type.tsx b/apps/web/src/components/formatter/template-type.tsx
index 3bcb3b05e..f17728391 100644
--- a/apps/web/src/components/formatter/template-type.tsx
+++ b/apps/web/src/components/formatter/template-type.tsx
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from 'react';
-import { Globe, Lock } from 'lucide-react';
+import { Globe2, Lock } from 'lucide-react';
import type { LucideIcon } from 'lucide-react/dist/lucide-react';
import type { TemplateType as TemplateTypePrisma } from '@documenso/prisma/client';
@@ -22,7 +22,7 @@ const TEMPLATE_TYPES: Record