From a49b95ac8e61f1e4fcac71ecd167e9de06f58548 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Mon, 17 Nov 2025 11:29:51 +0800 Subject: [PATCH 1/2] chore(release): 1.5.13 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0c9f0f5..0c71ae5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [1.5.13](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.12...v1.5.13) (2025-11-17) + ## [1.5.12](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.10...v1.5.12) (2025-11-13) ## [1.5.11](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.4.45...v1.5.11) (2025-11-07) diff --git a/package.json b/package.json index 85b96e7d..bce06a43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hipmi", - "version": "1.5.12", + "version": "1.5.13", "private": true, "prisma": { "seed": "bun prisma/seed.ts" From 14fbd1a6dd19a7fd2a9092f5dbae33ae55f5f728 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Mon, 17 Nov 2025 11:29:54 +0800 Subject: [PATCH 2/2] Fix: - Merubah kode dan menambah enCode untuk dikirim ke Whatsapp - src/app/api/auth/login/route.ts & src/app/api/auth/resend/route.ts ### No Issue --- sendWhatsapp.js | 30 ++++++++++++++++++++++++++++++ src/app/api/auth/login/route.ts | 13 ++++++------- src/app/api/auth/resend/route.ts | 10 ++++++---- 3 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 sendWhatsapp.js diff --git a/sendWhatsapp.js b/sendWhatsapp.js new file mode 100644 index 00000000..b6db30ea --- /dev/null +++ b/sendWhatsapp.js @@ -0,0 +1,30 @@ +// sendWhatsapp.js + +// --- INPUT MANUAL --- +let phoneNumber = "6282340374412"; +const codeOtp = "3546"; +// --------------------- + +phoneNumber = phoneNumber.replace(/\D/g, ""); + +// Format pesan +const message = + `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n` + + `>> Kode OTP anda: ${codeOtp}.`; + +const encodedMessage = encodeURIComponent(message); + +const waLink = `https://wa.wibudev.com/code?nom=${phoneNumber}&text=${encodedMessage}`; + +console.log("Mengirim request ke server...\n"); + +// Jalankan HTTP GET +fetch(waLink) + .then(res => res.text()) + .then(data => { + console.log("Response dari server:"); + console.log(data); + }) + .catch(err => { + console.error("Terjadi error:", err); + }); diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts index aae133d9..287fd1ef 100644 --- a/src/app/api/auth/login/route.ts +++ b/src/app/api/auth/login/route.ts @@ -29,11 +29,12 @@ export async function POST(req: Request) { { status: 400 } ); + const msg = `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n>> Kode OTP anda: ${codeOtp}.`; + const encodedMsg = encodeURIComponent(msg); + const res = await fetch( - `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya. - \n - >> Kode OTP anda: ${codeOtp}. - ` + `https://wa.wibudev.com/code?nom=${nomor}&text=${encodedMsg}`, + { cache: "no-cache" } ); const sendWa = await res.json(); @@ -62,7 +63,5 @@ export async function POST(req: Request) { }, { status: 500 } ); - } finally { - await prisma.$disconnect(); - } + } } diff --git a/src/app/api/auth/resend/route.ts b/src/app/api/auth/resend/route.ts index c32f7e99..b0f8870d 100644 --- a/src/app/api/auth/resend/route.ts +++ b/src/app/api/auth/resend/route.ts @@ -16,14 +16,16 @@ export async function POST(req: Request) { const body = await req.json(); const { nomor } = body; + const msg = `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n>> Kode OTP anda: ${codeOtp}.`; + const encodedMsg = encodeURIComponent(msg); + const res = await fetch( - `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya. - \n - >> Kode OTP anda: ${codeOtp}. - ` + `https://wa.wibudev.com/code?nom=${nomor}&text=${encodedMsg}`, + { cache: "no-cache" } ); const sendWa = await res.json(); + if (sendWa.status !== "success") return NextResponse.json( {