Fixing minor bug in the invite flow which was causing the password to be hashed twice

This commit is contained in:
Arpit Mohan 2020-01-16 16:59:49 +05:30
parent bf6a80074e
commit ebfddeda94

View File

@ -419,9 +419,9 @@ public class UserServiceImpl extends BaseService<UserRepository, User, String> i
.flatMap(userToDelete -> inviteUserRepository.delete(userToDelete))
.thenReturn(true);
}
log.debug("The user doesn't exist in the system. Creating a new one");
log.debug("The invited user {} doesn't exist in the system. Creating a new record", inviteUser.getEmail());
// The user doesn't exist in the system. Create a new user object
newUser.setPassword(passwordEncoder.encode(inviteUser.getPassword()));
newUser.setPassword(inviteUser.getPassword());
return this.create(newUser)
.flatMap(createdUser -> addUserToOrganization(newUser.getCurrentOrganizationId(), createdUser))
.thenReturn(newUser)