Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

add login page

Marc Seitz4f3b77629a8b
diff --git a/pages/index.tsx b/pages/index.tsx
index 2c3de6ab..980aba2e 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -1,18 +1,7 @@
-import { signIn, useSession } from "next-auth/react";
import Link from "next/link";
export default function Example() {
- const { data: session } = useSession();
- function signInOrRedirect() {
- if (session) {
- window.location.href = "/documents";
- } else {
- signIn("google", {
- callbackUrl: `${window.location.origin}/welcome`,
- });
- }
- }
return (
<div className="max-h-screen relative isolate overflow-hidden bg-black">
<div
@@ -38,9 +27,8 @@ export default function Example() {
</p>
<div className="mt-10 flex items-center gap-x-6">
<Link
- onClick={() => signInOrRedirect()}
className="rounded-md bg-indigo-500 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400"
- href={""}
+ href={"/login"}
>
Get started
</Link>
diff --git a/pages/login.tsx b/pages/login.tsx
new file mode 100644
index 00000000..d88753d7
--- /dev/null
+++ b/pages/login.tsx
@@ -0,0 +1,44 @@
+import { signIn } from "next-auth/react";
+import { useRouter } from "next/router";
+
+export default function Login() {
+ const router = useRouter();
+ const { next } = router.query as { next?: string };
+
+ return (
+ <div className="flex h-screen w-screen justify-center">
+ <div
+ className="absolute inset-x-0 top-10 -z-10 flex transform-gpu justify-center overflow-hidden blur-3xl"
+ aria-hidden="true"
+ >
+ <div
+ className="aspect-[1108/632] w-[69.25rem] flex-none bg-gradient-to-r from-[#80caff] to-[#4f46e5] opacity-20"
+ style={{
+ clipPath:
+ "polygon(73.6% 51.7%, 91.7% 11.8%, 100% 46.4%, 97.4% 82.2%, 92.5% 84.9%, 75.7% 64%, 55.3% 47.5%, 46.5% 49.4%, 45% 62.9%, 50.3% 87.2%, 21.3% 64.1%, 0.1% 100%, 5.4% 51.1%, 21.4% 63.9%, 58.9% 0.2%, 73.6% 51.7%)",
+ }}
+ />
+ </div>
+ <div className="z-10 mt-[calc(30vh)] h-fit w-full max-w-md overflow-hidden border border-gray-900 rounded-lg sm:shadow-xl">
+ <div className="flex flex-col items-center justify-center space-y-3 bg-gray-800 px-4 py-6 pt-8 text-center sm:px-16">
+ <h3 className="text-xl text-white font-semibold">Sign in to Papermark</h3>
+ <p className="text-sm text-gray-400">
+ Start sharing documents with insights.
+ </p>
+ </div>
+ <div className="flex flex-col bg-gray-800 px-4 py-8 sm:px-16">
+ <button
+ onClick={() => {
+ signIn("google", {
+ ...(next && next.length > 0 ? { callbackUrl: next } : {}),
+ });
+ }}
+ className="rounded px-10 py-2 font-medium transition-colors text-gray-900 bg-gray-100 hover:text-gray-100 hover:bg-gray-500"
+ >
+ Continue with Google
+ </button>
+ </div>
+ </div>
+ </div>
+ );
+}