fix: temporarily remove botid from demo (#1438)
This commit is contained in:
parent
314f8ced57
commit
5c941dd830
6 changed files with 3 additions and 51 deletions
|
|
@ -7,7 +7,6 @@ import {
|
|||
stepCountIs,
|
||||
streamText,
|
||||
} from "ai";
|
||||
import { checkBotId } from "botid/server";
|
||||
import { after } from "next/server";
|
||||
import { createResumableStreamContext } from "resumable-stream";
|
||||
import { auth, type UserType } from "@/app/(auth)/auth";
|
||||
|
|
@ -64,14 +63,7 @@ export async function POST(request: Request) {
|
|||
const { id, message, messages, selectedChatModel, selectedVisibilityType } =
|
||||
requestBody;
|
||||
|
||||
const [botResult, session] = await Promise.all([
|
||||
checkBotId().catch(() => null),
|
||||
auth(),
|
||||
]);
|
||||
|
||||
if (botResult?.isBot) {
|
||||
return new ChatbotError("unauthorized:chat").toResponse();
|
||||
}
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user) {
|
||||
return new ChatbotError("unauthorized:chat").toResponse();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue