[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]

This commit is contained in:
TSM.ID
2026-05-25 03:50:05 +07:00
commit e820143b3c
673 changed files with 101320 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function proxy(request: NextRequest) {
// Mengekstrak HttpOnly Cookie dari Pilar 1
const token = request.cookies.get('jumpa_token')?.value;
// Jika token tidak ada, tendang pengguna ke halaman Login Pilar 1
if (!token) {
// Redirect ke root IAM menggunakan absolute URL agar keluar dari basePath /c
const loginUrl = new URL('/', request.url);
return NextResponse.redirect(loginUrl);
}
// Jika ada, izinkan masuk ke halaman antarmuka Chat
return NextResponse.next();
}
export const config = {
matcher: [
// Terapkan ke semua rute halaman, kecuali aset statis dan API internal
'/((?!api|_next/static|_next/image|favicon.ico).*)',
],
};