Deskripsi:
- link otp baru

NOIssues
This commit is contained in:
2026-03-05 14:15:36 +08:00
parent d6217aecf1
commit 7060a2d165
2 changed files with 8 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ export default function ViewLogin({ onValidate }: Props) {
} else {
return Toast.show({ type: 'small', text1: response.message, position: 'bottom' })
}
} catch (error : any ) {
} catch (error: any) {
console.error(error);
const message = error?.response?.data?.message || "Gagal login"

View File

@@ -13,18 +13,21 @@ export const apiCheckPhoneLogin = async (body: { phone: string }) => {
export const apiSendOtp = async (body: { phone: string, otp: number }) => {
const message = "Desa+\nMasukkan kode ini " + body.otp + " pada aplikasi Desa+ anda. Jangan berikan pada siapapun."
const textFix = encodeURIComponent(message)
// const res = await axios.get(`${Constants.expoConfig?.extra?.URL_OTP}/code?nom=${body.phone}&text=*Desa%2B*%0AMasukkan%20kode%20ini%20*${encodeURIComponent(body.otp)}*%20pada%20aplikasi%20Desa%2B%20anda.%20Jangan%20berikan%20pada%20siapapun.`)
const res = await fetch(
`${Constants.expoConfig?.extra?.URL_OTP}/code?nom=${body.phone}&text=${textFix}`,
`${Constants.expoConfig?.extra?.URL_OTP}/api/wa/send-text`,
{
cache: "no-cache",
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${Constants.expoConfig?.extra?.WA_SERVER_TOKEN}`,
},
body: JSON.stringify({
number: body.phone,
text: message
})
}
);
return res.status
}