first commit
This commit is contained in:
13
calcom/packages/features/tasker/api/cleanup.ts
Normal file
13
calcom/packages/features/tasker/api/cleanup.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { NextRequest } from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
import tasker from "..";
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const authHeader = request.headers.get("authorization");
|
||||
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
|
||||
return new Response("Unauthorized", { status: 401 });
|
||||
}
|
||||
await tasker.cleanup();
|
||||
return NextResponse.json({ success: true });
|
||||
}
|
||||
Reference in New Issue
Block a user