Skip to content

Commit

Permalink
Merge pull request #9 from clerk/integrate-clerk-core2-with-nextjs
Browse files Browse the repository at this point in the history
Integrate clerk core2 with nextjs
  • Loading branch information
royanger authored Apr 23, 2024
2 parents 7328a3e + 929540b commit 6a9c1b3
Show file tree
Hide file tree
Showing 12 changed files with 1,795 additions and 1,435 deletions.
7 changes: 7 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { clerkMiddleware } from "@clerk/nextjs/server";

export default clerkMiddleware();

export const config = {
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
};
3,138 changes: 1,755 additions & 1,383 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@clerk/nextjs": "^4.29.7",
"@clerk/nextjs": "^5.0.1",
"next": "14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
28 changes: 28 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import "@/styles/globals.css";
import {
ClerkProvider,
SignInButton,
SignedIn,
SignedOut,
UserButton,
} from "@clerk/nextjs";
import type { AppProps } from "next/app";

function MyApp({ Component, pageProps }: AppProps) {
return (
<ClerkProvider {...pageProps}>
<header>
<SignedOut>
<SignInButton />
</SignedOut>
<SignedIn>
<UserButton afterSignOutUrl="/" />
</SignedIn>
</header>

<Component {...pageProps} />
</ClerkProvider>
);
}

export default MyApp;
File renamed without changes.
3 changes: 3 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <h1>Home Page</h1>;
}
11 changes: 0 additions & 11 deletions src/middleware.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/pages/_app.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions src/pages/api/hello.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/pages/index.tsx

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": ["./src/*"]
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
Expand Down

0 comments on commit 6a9c1b3

Please sign in to comment.