chore: apply PR 1495 and update changelog

This commit is contained in:
diegosouzapw
2026-04-21 21:12:29 -03:00
parent 98c5b250b9
commit a7b6dfb06e
204 changed files with 2515 additions and 1652 deletions

View File

@@ -3,6 +3,7 @@
import { NextResponse } from "next/server";
import fs from "fs/promises";
import path from "path";
import { requireCliToolsAuth } from "@/lib/api/requireCliToolsAuth";
import {
ensureCliConfigWriteAllowed,
getCliConfigPaths,
@@ -120,7 +121,10 @@ const hasOmniRouteConfig = (config: string | null) => {
};
// GET - Check codex CLI and read current settings
export async function GET() {
export async function GET(request: Request) {
const authError = await requireCliToolsAuth(request);
if (authError) return authError;
try {
const runtime = await getCliRuntimeStatus("codex");
@@ -161,6 +165,9 @@ export async function GET() {
// POST - Update OmniRoute settings (merge with existing config)
export async function POST(request: Request) {
const authError = await requireCliToolsAuth(request);
if (authError) return authError;
let rawBody;
try {
rawBody = await request.json();
@@ -301,7 +308,10 @@ export async function POST(request: Request) {
}
// DELETE - Remove OmniRoute settings only (keep other settings)
export async function DELETE() {
export async function DELETE(request: Request) {
const authError = await requireCliToolsAuth(request);
if (authError) return authError;
try {
const writeGuard = ensureCliConfigWriteAllowed();
if (writeGuard) {