feat(server): support importing users with password (#11978)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for an optional password field when creating a new user via the user creation form or API.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
forehalo
2025-04-25 03:38:34 +00:00
parent 0da5ef28d6
commit f0e2361e81
3 changed files with 6 additions and 1 deletions

View File

@@ -201,6 +201,9 @@ class CreateUserInput {
@Field(() => String, { nullable: true })
name?: string;
@Field(() => String, { nullable: true })
password?: string;
}
@InputType()
@@ -292,7 +295,7 @@ export class UserManagementResolver {
@Args({ name: 'input', type: () => CreateUserInput }) input: CreateUserInput
) {
const { id } = await this.models.user.create({
email: input.email,
...input,
registered: true,
});