This commit is contained in:
Stian Thorgersen 2014-08-29 17:11:18 +02:00
parent 39c0be5d99
commit 31b0f5543f
2 changed files with 11 additions and 8 deletions

View file

@ -504,7 +504,7 @@ public class AccountService {
String passwordConfirm = formData.getFirst("password-confirm");
if (requireCurrent) {
if (Validation.isEmpty(passwordNew)) {
if (Validation.isEmpty(password)) {
setReferrerOnPage();
return account.setError(Messages.MISSING_PASSWORD).createResponse(AccountPages.PASSWORD);
}
@ -516,6 +516,11 @@ public class AccountService {
}
}
if (Validation.isEmpty(passwordNew)) {
setReferrerOnPage();
return account.setError(Messages.MISSING_PASSWORD).createResponse(AccountPages.PASSWORD);
}
if (!passwordNew.equals(passwordConfirm)) {
setReferrerOnPage();
return account.setError(Messages.INVALID_PASSWORD_CONFIRM).createResponse(AccountPages.PASSWORD);
@ -690,6 +695,11 @@ public class AccountService {
public static boolean isPasswordSet(UserModel user) {
boolean passwordSet = false;
if (user.getFederationLink() != null) {
passwordSet = true;
}
for (UserCredentialValueModel c : user.getCredentialsDirectly()) {
if (c.getType().equals(CredentialRepresentation.PASSWORD)) {
passwordSet = true;

View file

@ -159,13 +159,6 @@ public class AccountTest {
});
}
@Ignore
@Test
public void forever() throws Exception{
while (true) Thread.sleep(5000);
}
@Test
public void returnToAppFromQueryParam() {
driver.navigate().to(AccountUpdateProfilePage.PATH + "?referrer=test-app");