1.0.0 • Published 4 years ago

otp_system v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

otp_system

Description

  1. เขียนระบบ otp สำหรับการยืนยันหมายเลขโทรศัพท์
  2. ฟังก์ชั่นจะประกอบด้วย 3 ส่วนหลักๆ คือ
  3. API การส่ง sms (ระบบภายนอก)
  4. ระบบ logic
  5. ระบบ 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