This commit is contained in:
Maze Winther
2026-01-15 11:05:17 +01:00
parent c19f085e48
commit deef784b76
182 changed files with 7787 additions and 18046 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { auth } from "@opencut/auth";
import { auth } from "@/lib/auth/server";
import { toNextJsHandler } from "better-auth/next-js";
export const { POST, GET } = toNextJsHandler(auth);
+4 -4
View File
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
import { z } from "zod";
import { AwsClient } from "aws4fetch";
import { nanoid } from "nanoid";
import { env } from "@/env";
import { webEnv } from "@opencut/env/web";
import { checkRateLimit } from "@/lib/rate-limit";
import { isTranscriptionConfigured } from "@/lib/transcription-utils";
@@ -64,15 +64,15 @@ export async function POST(request: NextRequest) {
const { fileExtension } = validationResult.data;
const client = new AwsClient({
accessKeyId: env.R2_ACCESS_KEY_ID,
secretAccessKey: env.R2_SECRET_ACCESS_KEY,
accessKeyId: webEnv.R2_ACCESS_KEY_ID,
secretAccessKey: webEnv.R2_SECRET_ACCESS_KEY,
});
const timestamp = Date.now();
const fileName = `audio/${timestamp}-${nanoid()}.${fileExtension}`;
const url = new URL(
`https://${env.R2_BUCKET_NAME}.${env.CLOUDFLARE_ACCOUNT_ID}.r2.cloudflarestorage.com/${fileName}`
`https://${webEnv.R2_BUCKET_NAME}.${webEnv.CLOUDFLARE_ACCOUNT_ID}.r2.cloudflarestorage.com/${fileName}`
);
url.searchParams.set("X-Amz-Expires", "3600"); // 1 hour expiry
+2 -2
View File
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { z } from "zod";
import { env } from "@/env";
import { webEnv } from "@opencut/env/web";
import { checkRateLimit } from "@/lib/rate-limit";
const searchParamsSchema = z.object({
@@ -200,7 +200,7 @@ export async function GET(request: NextRequest) {
const params = new URLSearchParams({
query: query || "",
token: env.FREESOUND_API_KEY,
token: webEnv.FREESOUND_API_KEY,
page: page.toString(),
page_size: pageSize.toString(),
sort: sortParam,
+2 -2
View File
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { z } from "zod";
import { env } from "@/env";
import { webEnv } from "@opencut/env/web";
import { checkRateLimit } from "@/lib/rate-limit";
import { isTranscriptionConfigured } from "@/lib/transcription-utils";
@@ -128,7 +128,7 @@ export async function POST(request: NextRequest) {
iv
});
const response = await fetch(env.MODAL_TRANSCRIPTION_URL, {
const response = await fetch(webEnv.MODAL_TRANSCRIPTION_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",