From 5babb726993cb8b83df397af14a7d11a357a91f0 Mon Sep 17 00:00:00 2001 From: weeihan Date: Sun, 16 Aug 2026 09:39:57 +0800 Subject: [PATCH] fix(evidence): disable HMAC token validation, use session auth only --- app/api/evidence/[...path]/route.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/api/evidence/[...path]/route.ts b/app/api/evidence/[...path]/route.ts index 01475b2..1eb2fb4 100644 --- a/app/api/evidence/[...path]/route.ts +++ b/app/api/evidence/[...path]/route.ts @@ -17,14 +17,8 @@ export async function GET( const { path: segments } = await params const filePath = segments.join('/') - // Verify HMAC token (temporarily disabled for debugging) - // const token = request.nextUrl.searchParams.get('token') - // if (!token) return new NextResponse('Missing token', { status: 401 }) - // if (token.length !== 64) return new NextResponse('Invalid token', { status: 403 }) - // const expected = signEvidencePath(filePath) - // if (!crypto.timingSafeEqual(Buffer.from(token, 'hex'), Buffer.from(expected, 'hex'))) { - // return new NextResponse('Invalid token', { status: 403 }) - // } + // Token validation disabled - session + RLS provides auth + // TODO: implement client-side token generation and pass to frontend // Verify session const session = await getSession()