mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
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 })
|
||||
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,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user