fix ( middleware )

deskripsi:
- fix access api melalui middleware di: home, profile dan portofolio
This commit is contained in:
2025-01-08 10:39:18 +08:00
parent 18bd4efed1
commit cccb011da5
36 changed files with 1206 additions and 450 deletions

View File

@@ -0,0 +1,15 @@
import { cookies } from 'next/headers'
import { NextResponse } from 'next/server';
export const dynamic = "force-dynamic";
export async function GET(request: Request) {
try {
const cookiesKey = process.env.NEXT_PUBLIC_BASE_SESSION_KEY!
const cookieStore = cookies();
const hipmiKey = cookieStore.get(cookiesKey)?.value || '';
return NextResponse.json({ token: hipmiKey });
} catch (error) {
console.error(error);
return NextResponse.json({ error }, { status: 500 });
}
}