createUser static method
Future<User>
createUser(
{ - UserProfile? profile,
- UserIdentifier? identifier,
- String? password,
})
Implementation
static Future<User> createUser({
UserProfile? profile,
UserIdentifier? identifier,
String? password,
}) async {
HeraRequest req = HeraRequest()..namespace = _namespace;
User user = userWithIdentifiers(identifier);
user.profile = profile ?? UserProfile();
user.password = Hash(body: password ?? "");
req.user = user;
try {
HeraResponse resp = await _heraClient.create(req);
return resp.user;
} catch (e) {
if (kDebugMode) {
print("could not create user with err: $e");
}
rethrow;
}
}