IafUser
Use the IafUser API to create a new User account. It exposes only user creation; for other User operations such as get, update, or listing an organization's users, use IafPassSvc directly. To manage a UserGroup's members (list, invite, or remove users from a group), use IafUserGroup instead.
create
Creates a new User class object.
| Parameter | Required | Type | Description |
|---|---|---|---|
| userData | Yes | User | Pass a User object that contains the properties you want to define the user. |
| ctx | No | Ctx | ctx - Context, such as namespaces and authentication token information. |
Returns
Promise<User> - Resolves with the created User object
Examples
// Create a new user
const userData = {
_firstname: "First Name",
_lastname: "Last Name",
_email: "email@mailinator.com",
_password: "Test@123"
};
const user = await IafUser.create(userData, ctx);