feat(core): Add filtering, selection and pagination to users (#6994)

https://linear.app/n8n/issue/PAY-646
This commit is contained in:
Iván Ovejero
2023-08-28 16:13:17 +02:00
committed by GitHub
parent a7785b2c5d
commit b716241b42
23 changed files with 535 additions and 211 deletions

View File

@@ -1,12 +1,7 @@
import validator from 'validator';
import { plainToInstance } from 'class-transformer';
import { Authorized, Delete, Get, Patch, Post, RestController } from '@/decorators';
import {
compareHash,
hashPassword,
sanitizeUser,
validatePassword,
} from '@/UserManagement/UserManagementHelper';
import { compareHash, hashPassword, validatePassword } from '@/UserManagement/UserManagementHelper';
import { BadRequestError } from '@/ResponseHelper';
import { validateEntity } from '@/GenericHelpers';
import { issueCookie } from '@/auth/jwt';
@@ -89,9 +84,11 @@ export class MeController {
fields_changed: updatedKeys,
});
await this.externalHooks.run('user.profile.update', [currentEmail, sanitizeUser(user)]);
const publicUser = await this.userService.toPublic(user);
return sanitizeUser(user);
await this.externalHooks.run('user.profile.update', [currentEmail, publicUser]);
return publicUser;
}
/**