mirror of
https://github.com/documenso/documenso.git
synced 2025-11-21 20:21:38 +10:00
wip
This commit is contained in:
33
apps/remix/app/routes/_unauthenticated+/_layout.tsx
Normal file
33
apps/remix/app/routes/_unauthenticated+/_layout.tsx
Normal file
@ -0,0 +1,33 @@
|
||||
import { Outlet } from 'react-router';
|
||||
|
||||
import backgroundPattern from '@documenso/assets/images/background-pattern.png';
|
||||
|
||||
import type { Route } from './+types/_layout';
|
||||
|
||||
export const loader = async (args: Route.LoaderArgs) => {
|
||||
//
|
||||
};
|
||||
|
||||
export default function Layout() {
|
||||
return (
|
||||
<main className="relative flex min-h-screen flex-col items-center justify-center overflow-hidden px-4 py-12 md:p-12 lg:p-24">
|
||||
<div>
|
||||
<div className="absolute -inset-[min(600px,max(400px,60vw))] -z-[1] flex items-center justify-center opacity-70">
|
||||
<img
|
||||
src={backgroundPattern}
|
||||
alt="background pattern"
|
||||
className="dark:brightness-95 dark:contrast-[70%] dark:invert dark:sepia"
|
||||
style={{
|
||||
mask: 'radial-gradient(rgba(255, 255, 255, 1) 0%, transparent 80%)',
|
||||
WebkitMask: 'radial-gradient(rgba(255, 255, 255, 1) 0%, transparent 80%)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="relative w-full">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
33
apps/remix/app/routes/_unauthenticated+/check-email.tsx
Normal file
33
apps/remix/app/routes/_unauthenticated+/check-email.tsx
Normal file
@ -0,0 +1,33 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
|
||||
export function meta() {
|
||||
return [{ title: 'Forgot password' }];
|
||||
}
|
||||
|
||||
export default function ForgotPasswordPage() {
|
||||
return (
|
||||
<div className="w-screen max-w-lg px-4">
|
||||
<div className="w-full">
|
||||
<h1 className="text-4xl font-semibold">
|
||||
<Trans>Email sent!</Trans>
|
||||
</h1>
|
||||
|
||||
<p className="text-muted-foreground mb-4 mt-2 text-sm">
|
||||
<Trans>
|
||||
A password reset email has been sent, if you have an account you should see it in your
|
||||
inbox shortly.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<Button asChild>
|
||||
<Link to="/signin">
|
||||
<Trans>Return to sign in</Trans>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
38
apps/remix/app/routes/_unauthenticated+/forgot-password.tsx
Normal file
38
apps/remix/app/routes/_unauthenticated+/forgot-password.tsx
Normal file
@ -0,0 +1,38 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
import { ForgotPasswordForm } from '~/components/forms/forgot-password';
|
||||
|
||||
export function meta() {
|
||||
return [{ title: 'Forgot Password' }];
|
||||
}
|
||||
|
||||
export default function ForgotPasswordPage() {
|
||||
return (
|
||||
<div className="w-screen max-w-lg px-4">
|
||||
<div className="w-full">
|
||||
<h1 className="text-3xl font-semibold">
|
||||
<Trans>Forgot your password?</Trans>
|
||||
</h1>
|
||||
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
<Trans>
|
||||
No worries, it happens! Enter your email and we'll email you a special link to reset
|
||||
your password.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<ForgotPasswordForm className="mt-4" />
|
||||
|
||||
<p className="text-muted-foreground mt-6 text-center text-sm">
|
||||
<Trans>
|
||||
Remembered your password?{' '}
|
||||
<Link to="/signin" className="text-primary duration-200 hover:opacity-70">
|
||||
Sign In
|
||||
</Link>
|
||||
</Trans>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Link, redirect } from 'react-router';
|
||||
|
||||
import { getResetTokenValidity } from '@documenso/lib/server-only/user/get-reset-token-validity';
|
||||
|
||||
import { ResetPasswordForm } from '~/components/forms/reset-password';
|
||||
|
||||
import type { Route } from './+types/reset-password.$token';
|
||||
|
||||
export function meta() {
|
||||
return [{ title: 'Reset Password' }];
|
||||
}
|
||||
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const { token } = params;
|
||||
|
||||
const isValid = await getResetTokenValidity({ token });
|
||||
|
||||
if (!isValid) {
|
||||
redirect('/reset-password');
|
||||
}
|
||||
|
||||
return {
|
||||
token,
|
||||
};
|
||||
}
|
||||
|
||||
export default function ResetPasswordPage({ loaderData }: Route.ComponentProps) {
|
||||
const { token } = loaderData;
|
||||
|
||||
return (
|
||||
<div className="w-screen max-w-lg px-4">
|
||||
<div className="w-full">
|
||||
<h1 className="text-4xl font-semibold">
|
||||
<Trans>Reset Password</Trans>
|
||||
</h1>
|
||||
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
<Trans>Please choose your new password</Trans>
|
||||
</p>
|
||||
|
||||
<ResetPasswordForm token={token} className="mt-4" />
|
||||
|
||||
<p className="text-muted-foreground mt-6 text-center text-sm">
|
||||
<Trans>
|
||||
Don't have an account?{' '}
|
||||
<Link to="/signup" className="text-primary duration-200 hover:opacity-70">
|
||||
Sign up
|
||||
</Link>
|
||||
</Trans>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
33
apps/remix/app/routes/_unauthenticated+/reset-password.tsx
Normal file
33
apps/remix/app/routes/_unauthenticated+/reset-password.tsx
Normal file
@ -0,0 +1,33 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
|
||||
export function meta() {
|
||||
return [{ title: 'Reset Password' }];
|
||||
}
|
||||
|
||||
export default function ResetPasswordPage() {
|
||||
return (
|
||||
<div className="w-screen max-w-lg px-4">
|
||||
<div className="w-full">
|
||||
<h1 className="text-3xl font-semibold">
|
||||
<Trans>Unable to reset password</Trans>
|
||||
</h1>
|
||||
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
<Trans>
|
||||
The token you have used to reset your password is either expired or it never existed. If
|
||||
you have still forgotten your password, please request a new reset link.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<Button className="mt-4" asChild>
|
||||
<Link to="/signin">
|
||||
<Trans>Return to sign in</Trans>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
166
apps/remix/app/routes/_unauthenticated+/signature-disclosure.tsx
Normal file
166
apps/remix/app/routes/_unauthenticated+/signature-disclosure.tsx
Normal file
@ -0,0 +1,166 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
|
||||
const SUPPORT_EMAIL = 'support@documenso.com';
|
||||
|
||||
export default function SignatureDisclosure() {
|
||||
return (
|
||||
<div>
|
||||
<article className="prose dark:prose-invert">
|
||||
<h1>
|
||||
<Trans>Electronic Signature Disclosure</Trans>
|
||||
</h1>
|
||||
|
||||
<h2>
|
||||
<Trans>Welcome</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
Thank you for using Documenso to perform your electronic document signing. The purpose
|
||||
of this disclosure is to inform you about the process, legality, and your rights
|
||||
regarding the use of electronic signatures on our platform. By opting to use an
|
||||
electronic signature, you are agreeing to the terms and conditions outlined below.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Acceptance and Consent</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
When you use our platform to affix your electronic signature to documents, you are
|
||||
consenting to do so under the Electronic Signatures in Global and National Commerce Act
|
||||
(E-Sign Act) and other applicable laws. This action indicates your agreement to use
|
||||
electronic means to sign documents and receive notifications.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Legality of Electronic Signatures</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
An electronic signature provided by you on our platform, achieved through clicking
|
||||
through to a document and entering your name, or any other electronic signing method we
|
||||
provide, is legally binding. It carries the same weight and enforceability as a manual
|
||||
signature written with ink on paper.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>System Requirements</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>To use our electronic signature service, you must have access to:</Trans>
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<Trans>A stable internet connection</Trans>
|
||||
</li>
|
||||
<li>
|
||||
<Trans>An email account</Trans>
|
||||
</li>
|
||||
<li>
|
||||
<Trans>A device capable of accessing, opening, and reading documents</Trans>
|
||||
</li>
|
||||
<li>
|
||||
<Trans>A means to print or download documents for your records</Trans>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>
|
||||
<Trans>Electronic Delivery of Documents</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
All documents related to the electronic signing process will be provided to you
|
||||
electronically through our platform or via email. It is your responsibility to ensure
|
||||
that your email address is current and that you can receive and open our emails.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Consent to Electronic Transactions</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
By using the electronic signature feature, you are consenting to conduct transactions
|
||||
and receive disclosures electronically. You acknowledge that your electronic signature
|
||||
on documents is binding and that you accept the terms outlined in the documents you are
|
||||
signing.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Withdrawing Consent</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
You have the right to withdraw your consent to use electronic signatures at any time
|
||||
before completing the signing process. To withdraw your consent, please contact the
|
||||
sender of the document. In failing to contact the sender you may reach out to{' '}
|
||||
<a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a> for assistance. Be aware that
|
||||
withdrawing consent may delay or halt the completion of the related transaction or
|
||||
service.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Updating Your Information</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
It is crucial to keep your contact information, especially your email address, up to
|
||||
date with us. Please notify us immediately of any changes to ensure that you continue to
|
||||
receive all necessary communications.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Retention of Documents</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
After signing a document electronically, you will be provided the opportunity to view,
|
||||
download, and print the document for your records. It is highly recommended that you
|
||||
retain a copy of all electronically signed documents for your personal records. We will
|
||||
also retain a copy of the signed document for our records however we may not be able to
|
||||
provide you with a copy of the signed document after a certain period of time.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Acknowledgment</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
By proceeding to use the electronic signature service provided by Documenso, you affirm
|
||||
that you have read and understood this disclosure. You agree to all terms and conditions
|
||||
related to the use of electronic signatures and electronic transactions as outlined
|
||||
herein.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<Trans>Contact Information</Trans>
|
||||
</h2>
|
||||
<p>
|
||||
<Trans>
|
||||
For any questions regarding this disclosure, electronic signatures, or any related
|
||||
process, please contact us at: <a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a>
|
||||
</Trans>
|
||||
</p>
|
||||
</article>
|
||||
|
||||
<div className="mt-8">
|
||||
<Button asChild>
|
||||
<Link to="/documents">
|
||||
<Trans>Back to Documents</Trans>
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
63
apps/remix/app/routes/_unauthenticated+/signin.tsx
Normal file
63
apps/remix/app/routes/_unauthenticated+/signin.tsx
Normal file
@ -0,0 +1,63 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Link, redirect } from 'react-router';
|
||||
|
||||
import {
|
||||
IS_GOOGLE_SSO_ENABLED,
|
||||
IS_OIDC_SSO_ENABLED,
|
||||
OIDC_PROVIDER_LABEL,
|
||||
} from '@documenso/lib/constants/auth';
|
||||
|
||||
import { SignInForm } from '~/components/forms/signin';
|
||||
|
||||
import type { Route } from './+types/signin';
|
||||
import { getSession } from '@documenso/auth/server/lib/utils/get-session';
|
||||
|
||||
export function meta(_args: Route.MetaArgs) {
|
||||
return [{ title: 'Sign In' }];
|
||||
}
|
||||
|
||||
export async function loader({ request }: Route.LoaderArgs) {
|
||||
const session = await getSession(request)
|
||||
|
||||
if (session.isAuthenticated) {
|
||||
return redirect('/documents');
|
||||
}
|
||||
}
|
||||
|
||||
export default function SignIn() {
|
||||
// Todo
|
||||
// const NEXT_PUBLIC_DISABLE_SIGNUP = env('NEXT_PUBLIC_DISABLE_SIGNUP');
|
||||
const NEXT_PUBLIC_DISABLE_SIGNUP = 'false';
|
||||
|
||||
return (
|
||||
<div className="w-screen max-w-lg px-4">
|
||||
<div className="border-border dark:bg-background z-10 rounded-xl border bg-neutral-100 p-6">
|
||||
<h1 className="text-2xl font-semibold">
|
||||
<Trans>Sign in to your account</Trans>
|
||||
</h1>
|
||||
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
<Trans>Welcome back, we are lucky to have you.</Trans>
|
||||
</p>
|
||||
<hr className="-mx-6 my-4" />
|
||||
|
||||
<SignInForm
|
||||
isGoogleSSOEnabled={IS_GOOGLE_SSO_ENABLED}
|
||||
isOIDCSSOEnabled={IS_OIDC_SSO_ENABLED}
|
||||
oidcProviderLabel={OIDC_PROVIDER_LABEL}
|
||||
/>
|
||||
|
||||
{NEXT_PUBLIC_DISABLE_SIGNUP !== 'true' && (
|
||||
<p className="text-muted-foreground mt-6 text-center text-sm">
|
||||
<Trans>
|
||||
Don't have an account?{' '}
|
||||
<Link to="/signup" className="text-documenso-700 duration-200 hover:opacity-70">
|
||||
Sign up
|
||||
</Link>
|
||||
</Trans>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
31
apps/remix/app/routes/_unauthenticated+/signup.tsx
Normal file
31
apps/remix/app/routes/_unauthenticated+/signup.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import { redirect } from 'react-router';
|
||||
|
||||
import { IS_GOOGLE_SSO_ENABLED, IS_OIDC_SSO_ENABLED } from '@documenso/lib/constants/auth';
|
||||
|
||||
import { SignUpForm } from '~/components/forms/signup';
|
||||
|
||||
import type { Route } from './+types/_unauth.signup';
|
||||
|
||||
export function meta(_args: Route.MetaArgs) {
|
||||
return [{ title: 'Sign Up' }];
|
||||
}
|
||||
|
||||
export function loader() {
|
||||
// Todo
|
||||
// const NEXT_PUBLIC_DISABLE_SIGNUP = env('NEXT_PUBLIC_DISABLE_SIGNUP');
|
||||
const NEXT_PUBLIC_DISABLE_SIGNUP: string = 'false';
|
||||
|
||||
if (NEXT_PUBLIC_DISABLE_SIGNUP === 'true') {
|
||||
return redirect('/signin');
|
||||
}
|
||||
}
|
||||
|
||||
export default function SignUp() {
|
||||
return (
|
||||
<SignUpForm
|
||||
className="w-screen max-w-screen-2xl px-4 md:px-16 lg:-my-16"
|
||||
isGoogleSSOEnabled={IS_GOOGLE_SSO_ENABLED}
|
||||
isOIDCSSOEnabled={IS_OIDC_SSO_ENABLED}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
import { Trans } from '@lingui/macro';
|
||||
import { Mails } from 'lucide-react';
|
||||
|
||||
import { SendConfirmationEmailForm } from '~/components/forms/send-confirmation-email';
|
||||
|
||||
export default function UnverifiedAccount() {
|
||||
return (
|
||||
<div className="w-screen max-w-lg px-4">
|
||||
<div className="flex items-start">
|
||||
<div className="mr-4 mt-1 hidden md:block">
|
||||
<Mails className="text-primary h-10 w-10" strokeWidth={2} />
|
||||
</div>
|
||||
<div className="">
|
||||
<h2 className="text-2xl font-bold md:text-4xl">
|
||||
<Trans>Confirm email</Trans>
|
||||
</h2>
|
||||
|
||||
<p className="text-muted-foreground mt-4">
|
||||
<Trans>
|
||||
To gain access to your account, please confirm your email address by clicking on the
|
||||
confirmation link from your inbox.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<p className="text-muted-foreground mt-4">
|
||||
<Trans>
|
||||
If you don't find the confirmation link in your inbox, you can request a new one
|
||||
below.
|
||||
</Trans>
|
||||
</p>
|
||||
|
||||
<SendConfirmationEmailForm />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user