mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
removed auth middleware from upload-avatar route
This commit is contained in:
@@ -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)),
|
||||||
|
|||||||
@@ -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 });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user