mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-01-30 16:43:37 +00:00
28 lines
619 B
TypeScript
28 lines
619 B
TypeScript
import { clerkMiddleware } from '@clerk/nextjs/server';
|
|
import arcjet, { shield, detectBot } from './lib/arcjet';
|
|
import { createMiddleware } from '@arcjet/next';
|
|
|
|
const aj = arcjet
|
|
.withRule(
|
|
shield({
|
|
mode: 'LIVE',
|
|
})
|
|
)
|
|
.withRule(
|
|
detectBot({
|
|
mode: 'LIVE',
|
|
allow: [
|
|
'CATEGORY:SEARCH_ENGINE',
|
|
'CATEGORY:VERCEL',
|
|
'CATEGORY:MONITOR',
|
|
'CATEGORY:PREVIEW',
|
|
'CATEGORY:OPTIMIZER',
|
|
],
|
|
})
|
|
);
|
|
|
|
export const config = {
|
|
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
|
|
};
|
|
|
|
export default createMiddleware(aj, clerkMiddleware());
|