Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2024-10-03 09:19:32 -04:00
parent 8184fece1b
commit 0dabe6e399
No known key found for this signature in database

View File

@ -23,11 +23,8 @@ const aj = arcjet({
export default async function middleware(req: NextRequest) { export default async function middleware(req: NextRequest) {
const decision = await aj.protect(req); const decision = await aj.protect(req);
console.log(decision);
if ( if (
// If this deny comes from a bot rule then block the request. You can
// customize this logic to fit your needs e.g. changing the status code.
decision.isDenied() && decision.isDenied() &&
decision.reason.isBot() decision.reason.isBot()
) { ) {