removed auth middleware from upload-avatar route

This commit is contained in:
2026-02-05 11:12:17 +00:00
parent ac9a3063a3
commit 706fd037a6
2 changed files with 3 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ const main = async () => {
"/user/by-username": withGlobalAuthed(withAuth(routes.userByUsername)), "/user/by-username": withGlobalAuthed(withAuth(routes.userByUsername)),
"/user/update": withGlobalAuthed(withAuth(withCSRF(routes.userUpdate))), "/user/update": withGlobalAuthed(withAuth(withCSRF(routes.userUpdate))),
"/user/upload-avatar": withGlobalAuthed(withAuth(routes.userUploadAvatar)), "/user/upload-avatar": withGlobal(routes.userUploadAvatar),
"/issue/create": withGlobalAuthed(withAuth(withCSRF(routes.issueCreate))), "/issue/create": withGlobalAuthed(withAuth(withCSRF(routes.issueCreate))),
"/issue/by-id": withGlobalAuthed(withAuth(routes.issueById)), "/issue/by-id": withGlobalAuthed(withAuth(routes.issueById)),

View File

@@ -1,6 +1,6 @@
import { randomUUID } from "node:crypto"; import { randomUUID } from "node:crypto";
import type { BunRequest } from "bun";
import sharp from "sharp"; import sharp from "sharp";
import type { AuthedRequest } from "../../auth/middleware";
// import { getSubscriptionByUserId } from "../../db/queries"; // import { getSubscriptionByUserId } from "../../db/queries";
import { s3Client, s3Endpoint, s3PublicUrl } from "../../s3"; import { s3Client, s3Endpoint, s3PublicUrl } from "../../s3";
@@ -17,7 +17,7 @@ async function isAnimatedGIF(buffer: Buffer): Promise<boolean> {
} }
} }
export default async function uploadAvatar(req: AuthedRequest) { export default async function uploadAvatar(req: BunRequest) {
if (req.method !== "POST") { if (req.method !== "POST") {
return new Response("method not allowed", { status: 405 }); return new Response("method not allowed", { status: 405 });
} }