Skip to content

Commit 963b03f

Browse files
committed
clerk auth
1 parent 1461b9c commit 963b03f

File tree

9 files changed

+314
-3
lines changed

9 files changed

+314
-3
lines changed

app/(login)/layout.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ReactNode } from "react";
2+
3+
const LoginLayout = ({ children }: { children: ReactNode }) => {
4+
return (
5+
<div className="px-4 md:container flex justify-center mt-10">
6+
{children}
7+
</div>
8+
);
9+
};
10+
11+
export default LoginLayout;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { SignIn } from "@clerk/nextjs";
2+
3+
export default function Page() {
4+
return <SignIn />;
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { SignUp } from "@clerk/nextjs";
2+
3+
export default function Page() {
4+
return <SignUp />;
5+
}

app/country/[cca3]/page.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { getCountry } from "@/lib/countries";
2-
31
import Link from "next/link";
2+
import BackButton from "@/app/components/shared/BackButton";
3+
import { getCountry } from "@/lib/countries";
44
import { Button } from "@/components/ui/button";
55
import { Country } from "@/app/types";
6-
import BackButton from "@/app/components/shared/BackButton";
76
import { notFound } from "next/navigation";
87

98
const CountryPage = async ({ params }: { params: { cca3: string } }) => {

app/globals.css

+4
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ body {
88

99
dd {
1010
@apply mb-2
11+
}
12+
13+
.cl-internal-1dauvpw {
14+
@apply hidden
1115
}

app/layout.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import "./globals.css";
44
import NavBar from "./components/shared/NavBar";
55
import { ThemeProvider } from "@/components/theme-provider";
66
import Footer from "./components/shared/Footer";
7+
import { ClerkProvider } from "@clerk/nextjs";
78

89
const notoSans = Noto_Sans({ subsets: ["latin"] });
910

@@ -18,6 +19,7 @@ export default function RootLayout({
1819
children: React.ReactNode;
1920
}>) {
2021
return (
22+
<ClerkProvider>
2123
<html lang="en">
2224
<body className={notoSans.className}>
2325
<ThemeProvider
@@ -34,5 +36,6 @@ export default function RootLayout({
3436
</ThemeProvider>
3537
</body>
3638
</html>
39+
</ClerkProvider>
3740
);
3841
}

middleware.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { clerkMiddleware } from "@clerk/nextjs/server";
2+
3+
export default clerkMiddleware();
4+
5+
export const config = {
6+
matcher: [
7+
// Skip Next.js internals and all static files, unless found in search params
8+
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
9+
// Always run for API routes
10+
'/(api|trpc)(.*)',
11+
],
12+
};

0 commit comments

Comments
 (0)