authentication and layout updates.
This commit is contained in:
parent
fa4a4a565c
commit
239ff1b33b
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,6 +26,7 @@ yarn-error.log*
|
|||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env*.local
|
.env*.local
|
||||||
|
.env
|
||||||
|
|
||||||
# vercel
|
# vercel
|
||||||
.vercel
|
.vercel
|
||||||
|
5
app/(auth)/(routes)/sign-in/[[...sign-in]]/page.tsx
Normal file
5
app/(auth)/(routes)/sign-in/[[...sign-in]]/page.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SignIn } from "@clerk/nextjs";
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return <SignIn />;
|
||||||
|
}
|
5
app/(auth)/(routes)/sign-up/[[...sign-up]]/page.tsx
Normal file
5
app/(auth)/(routes)/sign-up/[[...sign-up]]/page.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SignUp } from "@clerk/nextjs";
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return <SignUp />;
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
const AuthLayout = ( { children }: {children: React.ReactNode}) => {
|
const AuthLayout = ( { children }: {children: React.ReactNode}) => {
|
||||||
return (
|
return (
|
||||||
<div className="bg-red-500 h-full">
|
<div className="h-full flex items-center justify-center">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
11
app/(main)/(routes)/page.tsx
Normal file
11
app/(main)/(routes)/page.tsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { UserButton } from "@clerk/nextjs/app-beta";
|
||||||
|
|
||||||
|
export default function Home() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<UserButton
|
||||||
|
afterSignOutUrl="/"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
import './globals.css'
|
import './globals.css'
|
||||||
import type { Metadata } from 'next'
|
import type { Metadata } from 'next'
|
||||||
import { Open_Sans } from 'next/font/google'
|
import { Open_Sans } from 'next/font/google'
|
||||||
|
import { ClerkProvider } from '@clerk/nextjs'
|
||||||
|
|
||||||
const Font = Open_Sans({ subsets: ['latin'] })
|
const Font = Open_Sans({ subsets: ['latin'] })
|
||||||
|
|
||||||
@ -15,8 +16,10 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
|
<ClerkProvider>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body className={Font.className}>{children}</body>
|
<body className={Font.className}>{children}</body>
|
||||||
</html>
|
</html>
|
||||||
|
</ClerkProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
10
middleware.ts
Normal file
10
middleware.ts
Normal 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)(.*)'],
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user