From 47945414360057078c192df3c40cdd742c243b5d Mon Sep 17 00:00:00 2001 From: gibbyb Date: Mon, 3 Jun 2024 16:53:39 -0500 Subject: [PATCH] Add a top bar component, fix auth --- src/app/_components/ui/top_bar.tsx | 8 ++++++++ src/app/layout.tsx | 13 ++++++++++--- src/env.js | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 src/app/_components/ui/top_bar.tsx diff --git a/src/app/_components/ui/top_bar.tsx b/src/app/_components/ui/top_bar.tsx new file mode 100644 index 0000000..663b14b --- /dev/null +++ b/src/app/_components/ui/top_bar.tsx @@ -0,0 +1,8 @@ + +export function Top_Bar() { + return ( +
+ +
+ ); +}; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 5e6bd75..e4bfaa2 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,8 +1,10 @@ import "~/styles/globals.css"; - import { GeistSans } from "geist/font/sans"; +import type { Metadata } from "next"; +import { Top_Bar } from "~/app/_components/ui/top_bar"; +import { SessionProvider } from "next-auth/react"; -export const metadata = { +export const metadata: Metadata = { title: "Create T3 App", description: "Generated by create-t3-app", icons: [{ rel: "icon", url: "/favicon.ico" }], @@ -15,7 +17,12 @@ export default function RootLayout({ }) { return ( - {children} + + + + {children} + + ); } diff --git a/src/env.js b/src/env.js index 1e94df6..1509630 100644 --- a/src/env.js +++ b/src/env.js @@ -11,7 +11,7 @@ export const env = createEnv({ NODE_ENV: z .enum(["development", "test", "production"]) .default("development"), - NEXTAUTH_SECRET: + AUTH_SECRET: process.env.NODE_ENV === "production" ? z.string() : z.string().optional(), @@ -35,7 +35,7 @@ export const env = createEnv({ runtimeEnv: { DATABASE_URL: process.env.DATABASE_URL, NODE_ENV: process.env.NODE_ENV, - NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, + AUTH_SECRET: process.env.AUTH_SECRET, AUTH_GITHUB_ID: process.env.AUTH_GITHUB_ID, AUTH_GITHUB_SECRET: process.env.AUTH_GITHUB_SECRET, },