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
@@ -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,
});
+1
View File
@@ -340,6 +340,7 @@ input CreateCopilotPromptInput {
input CreateUserInput {
email: String!
name: String
password: String
}
type CredentialsRequirementType {
+1
View File
@@ -444,6 +444,7 @@ export interface CreateCopilotPromptInput {
export interface CreateUserInput {
email: Scalars['String']['input'];
name?: InputMaybe<Scalars['String']['input']>;
password?: InputMaybe<Scalars['String']['input']>;
}
export interface CredentialsRequirementType {