verifyPhone static method

Future<void> verifyPhone({
  1. UserIdentifier? identifier,
  2. required String code,
})

Implementation

static Future<void> verifyPhone({
  UserIdentifier? identifier,
  required String code,
}) async {
  User user = userWithIdentifiers(identifier);
  if (code == "") {
    throw Exception("email verification code is empty");
  }
  HeraRequest req = HeraRequest()..namespace = _namespace;
  VerificationCode verificationCode = VerificationCode();
  verificationCode.code = Hash(body: code);
  req.verificationCode = verificationCode;
  req.user = user;
  req.namespace = _namespace;
  await _heraClient.verifyPhone(req);
}