Updated to Clerk Core v2

This commit is contained in:
Ahmad 2024-03-21 17:15:27 -04:00
parent c8afb179b0
commit 45e5628713
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
27 changed files with 682 additions and 625 deletions

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { db } from '@/lib/db';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { redirect } from 'next/navigation';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { db } from '@/lib/db';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { db } from '@/lib/db';

View file

@ -1,6 +1,6 @@
'use server';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { revalidatePath } from 'next/cache';
import { ACTION, ENTITY_TYPE } from '@prisma/client';

View file

@ -1,5 +1,5 @@
import Link from 'next/link';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { Logo } from '@/components/logo';
import { Button } from '@/components/ui/button';

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { notFound, redirect } from 'next/navigation';
import { db } from '@/lib/db';

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { redirect } from 'next/navigation';
import { db } from '@/lib/db';

View file

@ -1,5 +1,5 @@
import Link from 'next/link';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { redirect } from 'next/navigation';
import { HelpCircle, User2 } from 'lucide-react';

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { redirect } from 'next/navigation';
import { db } from '@/lib/db';

View file

@ -1,5 +1,5 @@
import { startCase } from 'lodash';
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { OrgControl } from './_components/org-control';

View file

@ -1,10 +1,13 @@
import { Toaster } from 'sonner';
import { auth } from '@clerk/nextjs/server';
import { ClerkProvider } from '@clerk/nextjs';
import { ModalProvider } from '@/components/providers/modal-provider';
import { QueryProvider } from '@/components/providers/query-provider';
const PlatformLayout = ({ children }: { children: React.ReactNode }) => {
auth().protect();
return (
<ClerkProvider>
<QueryProvider>

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { ENTITY_TYPE } from '@prisma/client';
import { NextResponse } from 'next/server';

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { NextResponse } from 'next/server';
import { db } from '@/lib/db';

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { db } from '@/lib/db';
import { MAX_FREE_BOARDS } from '@/constants/boards';

View file

@ -1,4 +1,4 @@
import { auth } from '@clerk/nextjs';
import { auth } from '@clerk/nextjs/server';
import { db } from '@/lib/db';

View file

@ -1,4 +1,19 @@
import { authMiddleware, redirectToSignIn } from '@clerk/nextjs';
/**
* New Middleware
*/
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware();
export const config = {
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
};
/**
* Old Middleware
*/
/* import { authMiddleware, redirectToSignIn } from '@clerk/nextjs';
import { NextResponse } from 'next/server';
export default authMiddleware({
@ -17,4 +32,4 @@ export default authMiddleware({
export const config = {
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
};
}; */

1233
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@
"format:fix": "prettier --write --ignore-path .gitignore ."
},
"dependencies": {
"@clerk/nextjs": "^4.29.9",
"@clerk/nextjs": "^5.0.0-beta.35",
"@hello-pangea/dnd": "^16.5.0",
"@liveblocks/client": "^1.10.2",
"@liveblocks/node": "^1.11.0",
@ -35,9 +35,9 @@
"lodash": "^4.17.21",
"lucide-react": "^0.360.0",
"next": "14.1.4",
"react": "^18",
"react": "^18.2.0",
"react-day-picker": "^8.10.0",
"react-dom": "^18",
"react-dom": "^18.2.0",
"sonner": "^1.4.32",
"stripe": "^14.21.0",
"tailwind-merge": "^2.2.2",