Fix WA Otp

### NO Issue
This commit is contained in:
2026-03-05 16:38:31 +08:00
parent cbfd105134
commit b2305a35a6

View File

@@ -7,23 +7,24 @@ const sendCodeOtp = async ({
codeOtp?: string; codeOtp?: string;
newMessage?: string; newMessage?: string;
}) => { }) => {
const msg = newMessage || `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n>> Kode OTP anda: ${codeOtp}.`; const msg =
const enCode = encodeURIComponent(msg); newMessage ||
const res = await fetch( `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n>> Kode OTP anda: ${codeOtp}.`;
`https://cld-dkr-prod-wajs-server.wibudev.com/api/wa/code?nom=${nomor}&text=${enCode}`, const enCode = msg;
{
cache: "no-cache", const res = await fetch(`https://otp.wibudev.com/api/wa/send-text`, {
headers: { method: "POST",
Authorization: `Bearer ${process.env.WA_SERVER_TOKEN}`, headers: {
}, "Content-Type": "application/json",
Authorization: `Bearer ${process.env.WA_SERVER_TOKEN}`,
}, },
); body: JSON.stringify({
// const res = await fetch( number: nomor,
// `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. text: enCode,
// \n }),
// >> Kode OTP anda: ${codeOtp}. });
// `,
// ); console.log("RES >>", res);
return res; return res;
}; };