Skip to content

Commit

Permalink
chore: added auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschultheiss committed Oct 28, 2023
1 parent 50ccb78 commit e60556a
Show file tree
Hide file tree
Showing 5 changed files with 448 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .env.example
Expand Up @@ -17,6 +17,5 @@ DATABASE_HOST=aws.connect.psdb.cloud
DATABASE_USERNAME=e86foscnkh7700uhw4as
DATABASE_PASSWORD=
DATABASE_TABLE=nosh-nodes
# Example:
# SERVERVAR="foo"
# NEXT_PUBLIC_CLIENTVAR="bar"
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_c21hcnQtbGlvbmVzcy04Ni5jbGVyay5hY2NvdW50cy5kZXYk
CLERK_SECRET_KEY=
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -11,6 +11,7 @@
"start": "next start"
},
"dependencies": {
"@clerk/nextjs": "^4.26.1",
"@planetscale/database": "^1.11.0",
"@t3-oss/env-nextjs": "^0.7.0",
"@tanstack/react-query": "^4.32.6",
Expand Down
13 changes: 8 additions & 5 deletions src/app/layout.tsx
@@ -1,5 +1,6 @@
import "~/styles/globals.css";

import { ClerkProvider } from "@clerk/nextjs";
import { Inter } from "next/font/google";
import { headers } from "next/headers";

Expand All @@ -22,10 +23,12 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={`font-sans ${inter.variable}`}>
<TRPCReactProvider headers={headers()}>{children}</TRPCReactProvider>
</body>
</html>
<ClerkProvider>
<html lang="en">
<body className={`font-sans ${inter.variable}`}>
<TRPCReactProvider headers={headers()}>{children}</TRPCReactProvider>
</body>
</html>
</ClerkProvider>
);
}
10 changes: 10 additions & 0 deletions src/middleware.ts
@@ -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)(.*)"],
// };

0 comments on commit e60556a

Please sign in to comment.