Skip to content

Commit 5d96c01

Browse files
Nextjs Patch + Clerk Version Leap (#179)
1 parent 61e422b commit 5d96c01

File tree

39 files changed

+350
-564
lines changed

39 files changed

+350
-564
lines changed

.infisical.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"workspaceId": "317c0122-35fe-4a35-80b8-27f4cefbe17a",
3+
"defaultEnvironment": "development",
4+
"gitBranchToEnvironmentMapping": null
5+
}

apps/web/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

apps/web/next.config.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ const nextConfig = {
1010
swcMinify: true,
1111
transpilePackages: ["db"],
1212
images: {
13-
domains: [
14-
"images.clerk.dev",
15-
"www.gravatar.com",
16-
"img.clerk.com",
17-
"api.dicebear.com",
18-
"cdn.discordapp.com",
19-
],
2013
remotePatterns: [
2114
{
2215
hostname: "**.blob.vercel-storage.com",
2316
},
17+
{ hostname: "images.clerk.dev" },
18+
{ hostname: "www.gravatar.com" },
19+
{ hostname: "img.clerk.com" },
20+
{ hostname: "api.dicebear.com" },
21+
{ hostname: "cdn.discordapp.com" },
2422
],
2523
},
2624
experimental: {

apps/web/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@aws-sdk/client-s3": "^3.750.0",
1414
"@aws-sdk/client-ses": "^3.616.0",
1515
"@aws-sdk/s3-request-presigner": "^3.750.0",
16-
"@clerk/nextjs": "^4.29.4",
16+
"@clerk/nextjs": "^6.12.12",
1717
"@gsap/react": "^2.1.1",
1818
"@hookform/resolvers": "^3.9.0",
1919
"@internationalized/date": "^3.5.4",
@@ -66,8 +66,9 @@
6666
"jiti": "^1.21.6",
6767
"lucide-react": "^0.411.0",
6868
"nanoid": "^5.0.7",
69-
"next": "14.2.5",
69+
"next": "14.2.25",
7070
"next-safe-action": "^7.9.3",
71+
"nextjs@4": "link:clerk/nextjs@4",
7172
"no-profanity": "^1.5.1",
7273
"pg": "^8.12.0",
7374
"postcss": "8.4.39",

apps/web/src/actions/user-profile-mod.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ export const updateProfileImage = authenticatedAction
196196
const file = await decodeBase64AsFile(fileBase64, fileName);
197197
let clerkUser: ClerkUser;
198198
try {
199-
clerkUser = await clerkClient.users.updateUserProfileImage(
200-
userId,
201-
{
202-
file,
203-
},
204-
);
199+
clerkUser = await (
200+
await clerkClient()
201+
).users.updateUserProfileImage(userId, {
202+
file,
203+
});
205204
} catch (err) {
206205
console.log(`Error updating Clerk profile image: ${err}`);
207206
if (

apps/web/src/app/admin/events/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { Button } from "@/components/shadcn/ui/button";
66
import { PlusCircle } from "lucide-react";
77
import Link from "next/link";
88
import { getAllEvents, getUser } from "db/functions";
9-
import { auth, redirectToSignIn } from "@clerk/nextjs/server";
9+
import { auth } from "@clerk/nextjs/server";
1010

1111
export default async function Page() {
12-
const { userId } = auth();
12+
const { userId, redirectToSignIn } = await auth();
1313
if (!userId) {
1414
return redirectToSignIn();
1515
}

apps/web/src/app/admin/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import c from "config";
22
import Image from "next/image";
3-
import { auth } from "@clerk/nextjs";
3+
import { auth } from "@clerk/nextjs/server";
44
import Link from "next/link";
55
import { Button } from "@/components/shadcn/ui/button";
66
import DashNavItem from "@/components/dash/shared/DashNavItem";
@@ -16,7 +16,7 @@ interface AdminLayoutProps {
1616
}
1717

1818
export default async function AdminLayout({ children }: AdminLayoutProps) {
19-
const { userId } = auth();
19+
const { userId } = await auth();
2020

2121
if (!userId) {
2222
return redirect("/sign-in");

apps/web/src/app/admin/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
} from "@/components/shadcn/ui/card";
99
import { Users, UserCheck, User2, TimerReset, MailCheck } from "lucide-react";
1010
import type { User } from "db/types";
11-
import { auth } from "@clerk/nextjs";
11+
import { auth } from "@clerk/nextjs/server";
1212
import { notFound } from "next/navigation";
1313
import { getAllUsers, getUser } from "db/functions";
1414

1515
export default async function Page() {
16-
const { userId } = auth();
16+
const { userId } = await auth();
1717
if (!userId) return notFound();
1818

1919
const adminUser = await getUser(userId);

apps/web/src/app/admin/users/[slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import {
1010
ProfileInfo,
1111
TeamInfo,
1212
} from "@/components/admin/users/ServerSections";
13-
import { auth } from "@clerk/nextjs";
13+
import { auth } from "@clerk/nextjs/server";
1414
import { notFound } from "next/navigation";
1515
import { isUserAdmin } from "@/lib/utils/server/admin";
1616
import ApproveUserButton from "@/components/admin/users/ApproveUserButton";
1717
import c from "config";
1818
import { getHacker, getUser } from "db/functions";
1919

2020
export default async function Page({ params }: { params: { slug: string } }) {
21-
const { userId } = auth();
21+
const { userId } = await auth();
2222

2323
if (!userId) return notFound();
2424

apps/web/src/app/api/admin/events/create/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { auth } from "@clerk/nextjs";
1+
import { auth } from "@clerk/nextjs/server";
22
import { db } from "db";
33
import { events } from "db/schema";
44
import { newEventFormSchema } from "@/validators/event";
@@ -11,7 +11,7 @@ import { getUser } from "db/functions";
1111

1212
// Make this a server action
1313
export async function POST(req: Request) {
14-
const { userId } = auth();
14+
const { userId } = await auth();
1515

1616
if (!userId) return new Response("Unauthorized", { status: 401 });
1717

0 commit comments

Comments
 (0)