Skip to content

Commit

Permalink
clerk fully working
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutlope committed Jan 17, 2024
1 parent a216601 commit 4fea8b5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ PINECONE_INDEX_NAME=

CLERK_SECRET_KEY=
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

POSTGRES_URL=
POSTGRES_URL_NON_POOLING=
Expand Down
1 change: 1 addition & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let url = 'https://www.pdftochat.com';
let sitename = 'pdftochat.com';

export const metadata: Metadata = {
metadataBase: new URL(url),
title,
description,
icons: {
Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { redirect } from 'next/navigation';

export default async function Home() {
const user: User | null = await currentUser();

const isLoggedIn = !!user;
if (isLoggedIn) {
redirect('/dashboard');
}

return (
<main className="sm:p-7">
<Header />
Expand Down
21 changes: 21 additions & 0 deletions app/sign-in/[[...sign-in]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Header from '@/components/home/Header';
import { SignIn } from '@clerk/nextjs';

export default function Page() {
return (
<div className="mt-5">
<Header />
<div className="flex mx-auto justify-center items-center mt-10">
<SignIn
appearance={{
elements: {
formButtonPrimary:
'bg-black hover:bg-gray-700 transition text-sm normal-case',
},
}}
afterSignInUrl="/dashboard"
/>
</div>
</div>
);
}
21 changes: 21 additions & 0 deletions app/sign-up/[[...sign-up]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Header from '@/components/home/Header';
import { SignUp } from '@clerk/nextjs';

export default function Page() {
return (
<div className="mt-5">
<Header />
<div className="flex mx-auto justify-center items-center mt-10">
<SignUp
appearance={{
elements: {
formButtonPrimary:
'bg-black hover:bg-gray-700 transition text-sm normal-case',
},
}}
afterSignUpUrl="/dashboard"
/>
</div>
</div>
);
}
18 changes: 8 additions & 10 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
@tailwind utilities;

@layer utilities {
@variants responsive {
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
}

Expand Down

1 comment on commit 4fea8b5

@vercel
Copy link

@vercel vercel bot commented on 4fea8b5 Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.