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,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)(.*)'],
};
}; */