ecourt+groups: N8 เปิดเอกสารจากลิงก์ ?fileUrl=&fileId=&typeId= (metadata-only + allowlist + ดึงไฟล์สด + login วนกลับ + การ์ดจำลองลิงก์ + path dev /samples) + N9 กลุ่มเอกสารตาม typeId — หน้ารายการจัด section ต่อกลุ่ม + "ไม่มีกลุ่ม" ท้ายสุด + หน้า /groups/[typeId] พร้อมหมายเหตุ "อาจไม่ครบทุกฉบับ" + docs sync ครบ (2026-09-23)
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
0aef3ff028
commit
329ae8e956
31 changed files with 2766 additions and 155 deletions
|
|
@ -8,8 +8,13 @@ export function middleware(req: NextRequest) {
|
|||
const user = parseOacCase(req.cookies.get(OAC_CASE_COOKIE)?.value);
|
||||
if (!user) {
|
||||
const url = req.nextUrl.clone();
|
||||
// N8 D5: เก็บ path+query ไว้วนกลับหลัง login (deep link จาก e-Court ไม่หาย)
|
||||
// — ไม่ใส่กรณี next เป็น "/" ไปเฉย ๆ ไม่ให้ /login มี query เกินจำเป็น
|
||||
// (path ตรงนี้ตัด basePath แล้ว / NextURL ใส่ basePath คืนตอน redirect เอง — invariant #12)
|
||||
const next = url.pathname + url.search;
|
||||
url.pathname = "/login";
|
||||
url.search = "";
|
||||
if (next !== "/") url.searchParams.set("next", next);
|
||||
return NextResponse.redirect(url);
|
||||
}
|
||||
return NextResponse.next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue