1.0.0 • Published 4 years ago
otp_system v1.0.0
otp_system
Description
- เขียนระบบ otp สำหรับการยืนยันหมายเลขโทรศัพท์
- ฟังก์ชั่นจะประกอบด้วย 3 ส่วนหลักๆ คือ
- API การส่ง sms (ระบบภายนอก)
- ระบบ logic
- ระบบ storage ที่รองรับ ttl (ไม่ต้องเขียน เพราะปลายทางอาจใช้ database ประเภทไหนก็ไม่รู้)
Manual Usage / Manual Test
npm start
Input Phone_number, Message => Ex: +66954856037, Test SMS
API Usage
(async () => {
const accountSid = `You account id`;
const authToken = `You auth token`;
const o = new otpClass(accountSid, authToken);
/**
* Function generate otp => o.generateOTP()
*/
const sms = await o.requestOTP(`Phone Number`, `Message`);
})()
1.0.0
4 years ago