refactor(lib): organize modules by feature
This commit is contained in:
@@ -4,7 +4,7 @@ import { Readable } from "node:stream";
|
||||
import { pipeline } from "node:stream/promises";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { NextResponse } from "next/server";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import { requireAdmin } from "@/lib/auth/auth";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import { saveVideoUpload } from "@/lib/video-upload-storage";
|
||||
import { requireAdmin } from "@/lib/auth/auth";
|
||||
import { saveVideoUpload } from "@/lib/video/video-upload-storage";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import NextAuth from "next-auth";
|
||||
import { authOptions } from "@/lib/auth-options";
|
||||
import { authOptions } from "@/lib/auth/auth-options";
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
export { handler as GET, handler as POST };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import { requireAdmin } from "@/lib/auth/auth";
|
||||
|
||||
const TIKTOK_OAUTH_STATE_COOKIE = "tiktok-oauth-state";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { randomBytes } from "node:crypto";
|
||||
import { cookies } from "next/headers";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import { requireAdmin } from "@/lib/auth/auth";
|
||||
|
||||
const TIKTOK_OAUTH_STATE_COOKIE = "tiktok-oauth-state";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import { requireAdmin } from "@/lib/auth/auth";
|
||||
|
||||
function escapeHtml(value: unknown) {
|
||||
return String(value ?? "")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse } from "next/server";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import { requireAdmin } from "@/lib/auth/auth";
|
||||
|
||||
const COOKIE = "youtube-oauth-state";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { processDueVideoUploads } from "@/lib/video-platforms";
|
||||
import { processDueVideoUploads } from "@/lib/video/video-platforms";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { db } from "@/db";
|
||||
import { cdn } from "@/db/schema";
|
||||
import { requireDiscordId } from "@/lib/auth";
|
||||
import { validateImageUploadFile, cdnUrl } from "@/lib/cdn-images";
|
||||
import { requireDiscordId } from "@/lib/auth/auth";
|
||||
import { validateImageUploadFile, cdnUrl } from "@/lib/cdn/cdn-images";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
let discordId: string;
|
||||
|
||||
Reference in New Issue
Block a user