【发布时间】:2018-12-04 11:48:36
【问题描述】:
您好,我正在做一个需要自动 otp 验证的项目,一旦用户输入电话号码。我已经在互联网上检查过,离子 1 角度 1 的示例。我需要带有打字稿的离子 3 示例。请帮助我举几个例子。
【问题讨论】:
标签: angular typescript ionic-framework
您好,我正在做一个需要自动 otp 验证的项目,一旦用户输入电话号码。我已经在互联网上检查过,离子 1 角度 1 的示例。我需要带有打字稿的离子 3 示例。请帮助我举几个例子。
【问题讨论】:
标签: angular typescript ionic-framework
我会告诉你哪些是自动 otp 验证。有时它会用于忘记密码
Pre requisites:
1. Backend Server
2. SMS Server
3. Ionic app
4. Idea on REST API
您可以设置两个触发后端发送 SMS OTP 的 restapi url,这是我的示例
1. /sendOtp - backend api which ionic call to send the OTP
ionic app -> sendOTP api -> SMS server -> ionic app.
a. ionic app : send info like phone number, type ex. reset-password and generated reference code
b. sendOTP api : it will generate a 6 digit otp and save in the database and send to SMS server
c. SMS server : it will send to phone number
d. ionic app : it will open otp page while waiting the OTP
2. /verifyOtp - backend api which verify the otp generated from backend and match to the database.
ionic app -> verifyOtp api -> SMS server -> ionic app
a. ionic app : after receiving the otp digit i will send the otp with reference code to verifyOtp api
b. verifyOtp api : i will accept and check if will match in the database and generate temporary password
c. SMS Server : i will send the temporary password to the ionic app.
d. ionic app : you can prompt thank you page or redirect to change password
您可以根据需要设计 api 防御。
【讨论】: