verifyEmail static method

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

Implementation

static Future<void> verifyEmail({
  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()..code = Hash(body: code));
  req.user = user;
  await _heraClient.verifyEmail(req);
}