Skip to content

Commit

Permalink
fix: generateTitle route
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinceBaghel258025 committed Nov 16, 2023
1 parent 1583dc2 commit 742fa65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/api/generateTitle/[chatid]/[orgid]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function POST(
method: "POST",
body: JSON.stringify({ chatTitle: fullResponse }),
headers: {
"z-zeplo-secret": env.ZEPLO_TOKEN,
"x-zeplo-secret": env.ZEPLO_TOKEN,
},
},
);
Expand Down
3 changes: 2 additions & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { authMiddleware } from "@clerk/nextjs";
import { NextRequest, NextResponse } from "next/server";
import { NextFetchEvent } from "next/server";
import { env } from "@/app/env.mjs";

// This is your original middleware
const clerkMiddleware = authMiddleware({
Expand All @@ -11,7 +12,7 @@ const clerkMiddleware = authMiddleware({
export async function middleware(req: NextRequest, event: NextFetchEvent) {
console.log("got into middleware");
// Check if the request is from Zeplo
if (req.headers.get("x-zeplo-secret") === process.env.ZEPLO_SECRET) {
if (req.headers.get("x-zeplo-secret") === env.ZEPLO_SECRET) {
// Handle the request without Clerk's authMiddleware
console.log("got into if");
// handleRequest(req, res);
Expand Down

0 comments on commit 742fa65

Please sign in to comment.