otp method

Future<Map<String, dynamic>> otp(
  1. String email, [
  2. String mobile = ''
])

Command to initiate an OTP-based login. Server will generate OTPs and send them to the email address and/or mobile.

The response should be checked for prefix values of the OTPs.

Implementation

Future<Map<String, dynamic>> otp(String email, [String mobile = '']) async {
  _otpEmail = email;
  Map<String, dynamic> map = {
    "action": "init",
    "email": email,
    "mobile": mobile,
  };
  return command("otp", map);
}