-
Add OTPLESS Sign in
Add the following code to your sign up/ sign in page where you want to embed your sign in functionality.
<div id="otpless-login-page"></div> <script type="text/javascript" src="https://otpless.com/auth.js" cid="YOUR_CID_HERE"></script> // Replace with your cid
-
Retrieve User's Information
Implement the following function to retrive the user data upon successful authentication of the user.
<script type="text/javascript"> function otpless(otplessUser) { alert(JSON.stringify(otplessUser)); } </script>
- OTPless-login-page - login page
- OTPless-script - script to integrate OTPless SDK
- Callback function - callback function to retrieve user data
Received User Data Format
// otpless user Format
{
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"timestamp": "YYYY-MM-DD HH:MM:SS",
"timezone": "+XX:XX",
"mobile": {
"name": "User Name",
"number": "User Mobile Number"
},
"email": {
"name": "User Name ",
"email": "User Email"
}
}