fix(token): restore environment variable checks for DOCVER_API_KEY and DOCVER_TOKEN_SECRET
All checks were successful
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 4s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Successful in 1m16s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Successful in 5s
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Successful in 0s

This commit is contained in:
Suphonchai Phoonsawat 2026-10-26 18:37:02 +07:00
parent ab62a2b3e2
commit 6ce071ee14
3 changed files with 16 additions and 18 deletions

View file

@ -28,13 +28,13 @@ export async function POST(request: Request) {
if (!parsed.ok) return docverError(parsed.error, 400);
// ความผิด config ฝั่ง server ไม่ใช่ความผิดของผู้เรียก — ไม่ตั้ง = 500 (ห้าม log ค่า secret)
// const secret = process.env.DOCVER_TOKEN_SECRET?.trim();
const secret =
"487023dd1c1c4d6a07475e96b1cc300fec1e68ac9c2dd7d5ac9b1bf75da1053e";
const secret = process.env.DOCVER_TOKEN_SECRET?.trim();
// const secret =
// "487023dd1c1c4d6a07475e96b1cc300fec1e68ac9c2dd7d5ac9b1bf75da1053e";
// if (secret === undefined || secret === "") {
// return docverError("DOCVER_TOKEN_SECRET ยังไม่ถูกตั้งค่า", 500);
// }
if (secret === undefined || secret === "") {
return docverError("DOCVER_TOKEN_SECRET ยังไม่ถูกตั้งค่า", 500);
}
const ttlRaw = Number(process.env.DOCVER_TOKEN_TTL_SECONDS);
const ttlSeconds =
Number.isFinite(ttlRaw) && ttlRaw > 0 ? Math.floor(ttlRaw) : 3600;