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:
@@ -201,6 +201,9 @@ class CreateUserInput {
|
|||||||
|
|
||||||
@Field(() => String, { nullable: true })
|
@Field(() => String, { nullable: true })
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
||||||
|
@Field(() => String, { nullable: true })
|
||||||
|
password?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
@@ -292,7 +295,7 @@ export class UserManagementResolver {
|
|||||||
@Args({ name: 'input', type: () => CreateUserInput }) input: CreateUserInput
|
@Args({ name: 'input', type: () => CreateUserInput }) input: CreateUserInput
|
||||||
) {
|
) {
|
||||||
const { id } = await this.models.user.create({
|
const { id } = await this.models.user.create({
|
||||||
email: input.email,
|
...input,
|
||||||
registered: true,
|
registered: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -340,6 +340,7 @@ input CreateCopilotPromptInput {
|
|||||||
input CreateUserInput {
|
input CreateUserInput {
|
||||||
email: String!
|
email: String!
|
||||||
name: String
|
name: String
|
||||||
|
password: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type CredentialsRequirementType {
|
type CredentialsRequirementType {
|
||||||
|
|||||||
@@ -444,6 +444,7 @@ export interface CreateCopilotPromptInput {
|
|||||||
export interface CreateUserInput {
|
export interface CreateUserInput {
|
||||||
email: Scalars['String']['input'];
|
email: Scalars['String']['input'];
|
||||||
name?: InputMaybe<Scalars['String']['input']>;
|
name?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
password?: InputMaybe<Scalars['String']['input']>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CredentialsRequirementType {
|
export interface CredentialsRequirementType {
|
||||||
|
|||||||
Reference in New Issue
Block a user