copilot-api / src /lib /approval.ts
imseldrith's picture
Initial upload from Colab
9e27976 verified
raw
history blame contribute delete
355 Bytes
import consola from "consola"
import { HTTPError } from "./error"
export const awaitApproval = async () => {
const response = await consola.prompt(`Accept incoming request?`, {
type: "confirm",
})
if (!response)
throw new HTTPError(
"Request rejected",
Response.json({ message: "Request rejected" }, { status: 403 }),
)
}