saasframe auth add-user
yarn saasframe auth add-user creates a new user, hashes the provided password, and links the account to roles in the same tenant as the organization.
Usage
yarn saasframe auth add-user \
--email "<user@email>" \
--password "<password>" \
--organizationId <uuid> \
[--roles role1,role2]
Aliases:
--orgor--orgIdfor--organizationId.
Behavior
- Loads the organization (and its tenant) by ID.
- Creates a confirmed user with the supplied credentials bound to the organization and tenant.
- For each role in
--roles:- Ensures the role exists (creating it if missing and scoping it to the tenant).
- Creates a
UserRolelink.
- Prints the new user’s UUID.
Example
ORG_ID=$(yarn saasframe auth list-orgs | awk 'NR==5 {print $1}')
yarn saasframe auth add-user \
--email manager@acme.dev \
--password ChangeMe123 \
--organizationId "$ORG_ID" \
--roles admin,employee
Output:
User created with id 7c2a91be-7f06-4c6e-9c28-2507a5e5992e
Troubleshooting
- Unknown organization – confirm the UUID exists (
yarn saasframe auth list-orgs) and that the CLI can connect to the database. - Role typos – misspelled roles are created automatically. If you need tenant-specific roles, create them beforehand and omit from other tenants.
- Password policies – the CLI enforces the same rules as the app. Configure them with
SF_PASSWORD_MIN_LENGTH,SF_PASSWORD_REQUIRE_DIGIT,SF_PASSWORD_REQUIRE_UPPERCASE, andSF_PASSWORD_REQUIRE_SPECIAL.