// region > helpers protected String currentUsersAtPath() { final ApplicationUser me = meService.me(); final ApplicationTenancy tenancy = me.getTenancy(); if (tenancy == null) { throw new IllegalStateException("No application tenancy defined"); } return tenancy.getPath(); }
@Override public boolean updatePasswordByEmail(final String emailAddress, final String password) { boolean passwordUpdated = false; final ApplicationUser user = applicationUserRepository.findByEmailAddress(emailAddress); if (user != null) { user.updatePassword(password); passwordUpdated = true; } return passwordUpdated; }
@Override public void registerUser(final UserDetails userDetails) { final Password password = new Password(userDetails.getPassword()); final ApplicationRole initialRole = getInitialRole(); final Boolean enabled = true; final String username = userDetails.getUsername(); final String emailAddress = userDetails.getEmailAddress(); final ApplicationUser applicationUser = applicationUserRepository.newLocalUser( username, password, password, initialRole, enabled, emailAddress); final Set<ApplicationRole> additionalRoles = getAdditionalInitialRoles(); if (additionalRoles != null) { for (final ApplicationRole additionalRole : additionalRoles) { applicationUser.addRole(additionalRole); } } }