mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-05-03 18:21:20 +00:00
feat: Revamped Authentication layer with Clerk
This commit is contained in:
parent
64179b81cc
commit
db122bcf59
6 changed files with 53 additions and 34 deletions
|
@ -1,2 +1,6 @@
|
|||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
|
||||
CLERK_SECRET_KEY=
|
||||
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
|
||||
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
|
||||
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/overview
|
||||
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/overview
|
||||
|
|
|
@ -1,31 +1,3 @@
|
|||
import { Particles } from "@/components/landing/particles";
|
||||
import {
|
||||
ClerkProvider,
|
||||
SignIn,
|
||||
SignedIn,
|
||||
SignedOut,
|
||||
} from "@clerk/nextjs/app-beta";
|
||||
|
||||
export default function AppLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<ClerkProvider>
|
||||
<SignedIn>{children}</SignedIn>
|
||||
<SignedOut>
|
||||
<div className="flex items-center justify-center w-screen h-screen">
|
||||
<Particles className="absolute inset-0 -z-10 " />
|
||||
|
||||
<SignIn
|
||||
appearance={{
|
||||
variables: {
|
||||
colorPrimary: "#161616",
|
||||
colorText: "#161616",
|
||||
},
|
||||
}}
|
||||
afterSignInUrl={"/overview"}
|
||||
afterSignUpUrl={"/overview"}
|
||||
/>
|
||||
</div>
|
||||
</SignedOut>
|
||||
</ClerkProvider>
|
||||
);
|
||||
return children;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import "tailwindcss/tailwind.css";
|
|||
import { ToastProvider } from "../toast-provider";
|
||||
|
||||
import { Metadata } from "next";
|
||||
import { ClerkProvider } from "@clerk/nextjs/app-beta";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
|
@ -67,11 +68,15 @@ export default async function RootLayout({ children }: RootLayoutProps) {
|
|||
suppressHydrationWarning
|
||||
className={[inter.variable, calSans.variable].join(" ")}
|
||||
>
|
||||
<head />
|
||||
<head>
|
||||
<meta charSet="utf-8"></meta>
|
||||
</head>
|
||||
<body className="min-h-screen antialiased">
|
||||
<ClerkProvider>
|
||||
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
|
||||
<ToastProvider>{children}</ToastProvider>
|
||||
</ThemeProvider>
|
||||
</ClerkProvider>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
|
|
19
app/sign-in/[[...sign-in]]/page.tsx
Normal file
19
app/sign-in/[[...sign-in]]/page.tsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { Particles } from "@/components/landing/particles";
|
||||
import { SignIn } from "@clerk/nextjs/app-beta";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="flex items-center justify-center w-screen h-screen">
|
||||
<Particles className="absolute inset-0 -z-10 " />
|
||||
|
||||
<SignIn
|
||||
appearance={{
|
||||
variables: {
|
||||
colorPrimary: "#161616",
|
||||
colorText: "#161616",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
19
app/sign-up/[[...sign-up]]/page.tsx
Normal file
19
app/sign-up/[[...sign-up]]/page.tsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { Particles } from "@/components/landing/particles";
|
||||
import { SignUp } from "@clerk/nextjs/app-beta";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="flex items-center justify-center w-screen h-screen">
|
||||
<Particles className="absolute inset-0 -z-10 " />
|
||||
|
||||
<SignUp
|
||||
appearance={{
|
||||
variables: {
|
||||
colorPrimary: "#161616",
|
||||
colorText: "#161616",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -17,7 +17,7 @@ export const Header: React.FC = () => {
|
|||
<li>
|
||||
<Link
|
||||
className="text-sm font-medium text-zinc-300 hover:text-white duration-500"
|
||||
href="/overview"
|
||||
href="/sign-in"
|
||||
>
|
||||
Sign in
|
||||
</Link>
|
||||
|
|
Loading…
Reference in a new issue