use of org.openremote.model.security.Credential in project openremote by openremote.
the class AdminUserEditActivity method handlePasswordReset.
protected void handlePasswordReset() {
String password = adminContent.getPassword();
String passwordControl = adminContent.getPasswordControl();
adminContent.clearPassword();
adminContent.clearPasswordControl();
if (password == null)
return;
if (!password.equals(passwordControl)) {
ConstraintViolation violation = new ConstraintViolation();
violation.setConstraintType(ConstraintViolation.Type.FIELD);
violation.setPath("password");
violation.setMessage(environment.getMessages().passwordsMustMatch());
validationErrorHandler.accept(new ConstraintViolation[] { violation });
return;
}
Credential credential = new Credential(password, false);
environment.getApp().getRequests().sendWith(credentialMapper, requestParams -> userResource.resetPassword(requestParams, realm, userId, credential), 204, () -> adminContent.addFormMessageSuccess(environment.getMessages().passwordUpdated()));
}
Aggregations