signInWithOtp method

Future<OtpStartResponse> signInWithOtp({
  1. String? email,
  2. String? phone,
})

Send a login OTP — signInWithOtp(email: …) or signInWithOtp(phone: …). Routes to email-OTP or phone-OTP by which arg is set. Exactly one of email / phone is required.

Implementation

Future<OtpStartResponse> signInWithOtp({String? email, String? phone}) {
  if (phone != null) return phoneStart(phone);
  if (email != null) return emailStart(email);
  throw ArgumentError('signInWithOtp requires either email or phone');
}