createScryptUser method
Create user with Scrypt password
Create a new user. Password provided must be hashed with the Scrypt algorithm. Use the POST /users endpoint to create users with a plain text password.
Implementation
Future<models.User> createScryptUser(
{required String userId,
required String email,
required String password,
required String passwordSalt,
required int passwordCpu,
required int passwordMemory,
required int passwordParallel,
required int passwordLength,
String? name}) async {
final String apiPath = '/users/scrypt';
final Map<String, dynamic> apiParams = {
'userId': userId,
'email': email,
'password': password,
'passwordSalt': passwordSalt,
'passwordCpu': passwordCpu,
'passwordMemory': passwordMemory,
'passwordParallel': passwordParallel,
'passwordLength': passwordLength,
'name': name,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.post,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.User.fromMap(res.data);
}