Fixed create user schema
MODIFY
src/assets/server/rest/v1/schemas/user/imported-user-create-req.json
src/assets/server/rest/v1/schemas/user/imported-user-create-req.json
"$ref": "user.json#/definitions/status"
},
"passwordWrongNbrTrials": {
- "$ref": ""
+ "$ref": "user.json#/definitions/passwordWrongNbrTrials"
},
"notificationsActive": {
"type": "boolean"

MODIFY
src/assets/server/rest/v1/schemas/user/user-create.json
src/assets/server/rest/v1/schemas/user/user-create.json
},
"notifications": {
"$ref": "user.json#/definitions/notifications"
+ },
+ "status": {
+ "$ref": "user.json#/definitions/status"
+ },
+ "plateID": {
+ "$ref": "user.json#/definitions/plateID"
+ },
+ "role": {
+ "$ref": "user.json#/definitions/role"
}
},
"required": [

MODIFY
src/server/rest/v1/service/TenantService.ts
src/server/rest/v1/service/TenantService.ts
@@ -313,13 +313,7 @@ export default class TenantService {
public static async handleUpdateTenant(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Check
- let filteredRequest;
-
- try {
- filteredRequest = TenantValidator.getInstance().validateTenantUpdateRequestSuperAdmin(req.body);
- } catch (e) {
- console.log(e);
- }
+ const filteredRequest = TenantValidator.getInstance().validateTenantUpdateRequestSuperAdmin(req.body);
// Check auth
if (!await Authorizations.canUpdateTenant(req.user)) {
throw new AppAuthError({

MODIFY
src/server/rest/v1/validator/UserValidator.ts
src/server/rest/v1/validator/UserValidator.ts
@@ -33,12 +33,7 @@ export default class UserValidator extends SchemaValidator {
}
validateUserCreate(user: any, loggedUser: UserToken): Partial<User> {
- const request = Utils.cloneObject(user);
this.validate(this.userCreate, user);
- if (Authorizations.isAdmin(loggedUser) || Authorizations.isSuperAdmin(loggedUser)) {
- this.validate(this.userAdminCreate, request);
- user = request;
- }
user.password = user.passwords.password;
return user;
}

Fixed create user schema