authentication and layout updates.

This commit is contained in:
Kyla 2023-10-07 13:10:50 -07:00
parent fa4a4a565c
commit 239ff1b33b
7 changed files with 39 additions and 4 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ yarn-error.log*
# local env files
.env*.local
.env
# vercel
.vercel

View File

@ -0,0 +1,5 @@
import { SignIn } from "@clerk/nextjs";
export default function Page() {
return <SignIn />;
}

View File

@ -0,0 +1,5 @@
import { SignUp } from "@clerk/nextjs";
export default function Page() {
return <SignUp />;
}

View File

@ -1,6 +1,6 @@
const AuthLayout = ( { children }: {children: React.ReactNode}) => {
return (
<div className="bg-red-500 h-full">
<div className="h-full flex items-center justify-center">
{children}
</div>
);

View File

@ -0,0 +1,11 @@
import { UserButton } from "@clerk/nextjs/app-beta";
export default function Home() {
return (
<div>
<UserButton
afterSignOutUrl="/"
/>
</div>
)
}

View File

@ -1,6 +1,7 @@
import './globals.css'
import type { Metadata } from 'next'
import { Open_Sans } from 'next/font/google'
import { ClerkProvider } from '@clerk/nextjs'
const Font = Open_Sans({ subsets: ['latin'] })
@ -15,8 +16,10 @@ export default function RootLayout({
children: React.ReactNode
}) {
return (
<ClerkProvider>
<html lang="en">
<body className={Font.className}>{children}</body>
</html>
</ClerkProvider>
)
}

10
middleware.ts Normal file
View File

@ -0,0 +1,10 @@
import { authMiddleware } from "@clerk/nextjs";
// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your middleware
export default authMiddleware({});
export const config = {
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
};