mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-01-31 00:53:37 +00:00
Updated to Clerk Core v2
This commit is contained in:
parent
c8afb179b0
commit
45e5628713
27 changed files with 682 additions and 625 deletions
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
import { ACTION, ENTITY_TYPE } from '@prisma/client';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
|
|
||||||
import { Logo } from '@/components/logo';
|
import { Logo } from '@/components/logo';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { notFound, redirect } from 'next/navigation';
|
import { notFound, redirect } from 'next/navigation';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
import { HelpCircle, User2 } from 'lucide-react';
|
import { HelpCircle, User2 } from 'lucide-react';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { startCase } from 'lodash';
|
import { startCase } from 'lodash';
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
|
|
||||||
import { OrgControl } from './_components/org-control';
|
import { OrgControl } from './_components/org-control';
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
import { Toaster } from 'sonner';
|
import { Toaster } from 'sonner';
|
||||||
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { ClerkProvider } from '@clerk/nextjs';
|
import { ClerkProvider } from '@clerk/nextjs';
|
||||||
|
|
||||||
import { ModalProvider } from '@/components/providers/modal-provider';
|
import { ModalProvider } from '@/components/providers/modal-provider';
|
||||||
import { QueryProvider } from '@/components/providers/query-provider';
|
import { QueryProvider } from '@/components/providers/query-provider';
|
||||||
|
|
||||||
const PlatformLayout = ({ children }: { children: React.ReactNode }) => {
|
const PlatformLayout = ({ children }: { children: React.ReactNode }) => {
|
||||||
|
auth().protect();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ClerkProvider>
|
<ClerkProvider>
|
||||||
<QueryProvider>
|
<QueryProvider>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { ENTITY_TYPE } from '@prisma/client';
|
import { ENTITY_TYPE } from '@prisma/client';
|
||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
import { MAX_FREE_BOARDS } from '@/constants/boards';
|
import { MAX_FREE_BOARDS } from '@/constants/boards';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { auth } from '@clerk/nextjs';
|
import { auth } from '@clerk/nextjs/server';
|
||||||
|
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
|
||||||
|
|
|
@ -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';
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
export default authMiddleware({
|
export default authMiddleware({
|
||||||
|
@ -17,4 +32,4 @@ export default authMiddleware({
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
|
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
|
||||||
};
|
}; */
|
||||||
|
|
1233
package-lock.json
generated
1233
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@
|
||||||
"format:fix": "prettier --write --ignore-path .gitignore ."
|
"format:fix": "prettier --write --ignore-path .gitignore ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clerk/nextjs": "^4.29.9",
|
"@clerk/nextjs": "^5.0.0-beta.35",
|
||||||
"@hello-pangea/dnd": "^16.5.0",
|
"@hello-pangea/dnd": "^16.5.0",
|
||||||
"@liveblocks/client": "^1.10.2",
|
"@liveblocks/client": "^1.10.2",
|
||||||
"@liveblocks/node": "^1.11.0",
|
"@liveblocks/node": "^1.11.0",
|
||||||
|
@ -35,9 +35,9 @@
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lucide-react": "^0.360.0",
|
"lucide-react": "^0.360.0",
|
||||||
"next": "14.1.4",
|
"next": "14.1.4",
|
||||||
"react": "^18",
|
"react": "^18.2.0",
|
||||||
"react-day-picker": "^8.10.0",
|
"react-day-picker": "^8.10.0",
|
||||||
"react-dom": "^18",
|
"react-dom": "^18.2.0",
|
||||||
"sonner": "^1.4.32",
|
"sonner": "^1.4.32",
|
||||||
"stripe": "^14.21.0",
|
"stripe": "^14.21.0",
|
||||||
"tailwind-merge": "^2.2.2",
|
"tailwind-merge": "^2.2.2",
|
||||||
|
|
Loading…
Reference in a new issue