registerByEmailCode static method

Future<AuthResult> registerByEmailCode(
  1. String email,
  2. String passCode, [
  3. RegisterOptions? options
])

register a new user by email address and a passcode.

Implementation

static Future<AuthResult> registerByEmailCode(String email, String passCode,
    [RegisterOptions? options]) async {
  var body = {
    'connection': 'PASSCODE',
    'passCodePayload': {'email': email, 'passCode': passCode},
  };
  var jsonBody = jsonEncode(body);
  if (options != null) {
    jsonBody = jsonEncode(options.setValues(body));
  }
  final Result result = await post('/api/v3/signup', jsonBody);
  // AuthResult authResult = AuthResult(result);
  // authResult.user = await createUser(result);
  return AuthResult(result);
}