No more cookie force dynamic

This commit is contained in:
Konstantin Wohlwend 2024-12-01 01:47:04 -08:00
parent cdc0dc1509
commit 65b88f786d
2 changed files with 1 additions and 5 deletions

View File

@ -2,7 +2,6 @@ import { handleApiRequest } from "@/route-handlers/smart-route-handler";
import { getEnvVariable } from "@stackframe/stack-shared/dist/utils/env";
import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
import { createNodeHttpServerDuplex } from "@stackframe/stack-shared/dist/utils/node-http";
import { cookies } from "next/headers";
import { NextRequest, NextResponse } from "next/server";
import { createOidcProvider } from "./idp";
@ -28,9 +27,6 @@ function getOidcCallbackPromise() {
}
const handler = handleApiRequest(async (req: NextRequest) => {
// force dynamic
cookies();
const newUrl = req.url.replace(pathPrefix, "");
if (newUrl === req.url) {
throw new StackAssertionError("No path prefix found in request URL. Is the pathPrefix correct?", { newUrl, url: req.url, pathPrefix });

View File

@ -78,7 +78,7 @@ export class StackAdminInterface extends StackServerInterface {
async createApiKey(
options: ApiKeyCreateCrudRequest,
): Promise<ApiKeyCreateCrudResponse> {
const response = await this.sendServerRequest(
const response = await this.sendAdminRequest(
"/internal/api-keys",
{
method: "POST",