Skip to content

Commit fd0d461

Browse files
committed
WebUserForm.java: pwError changed from AssertTrue to AssertFalse
1 parent 6e78297 commit fd0d461

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/de/rwth/idsg/steve/web/dto/WebUserForm.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
package de.rwth.idsg.steve.web.dto;
2020

21-
import jakarta.validation.constraints.AssertTrue;
21+
import jakarta.validation.constraints.AssertFalse;
2222
import jakarta.validation.constraints.NotNull;
2323
import jakarta.validation.constraints.Size;
2424
import lombok.Getter;
@@ -39,7 +39,7 @@ public class WebUserForm extends WebUserBaseForm {
3939
@Size(min = 8, message = "The repeated password also requires 8 or more characters")
4040
private String passwordComparison;
4141

42-
@AssertTrue(message = "The repeated password did not match!")
42+
@AssertFalse(message = "The repeated password did not match!")
4343
private Boolean pwError;
4444

4545
private String apiToken = "";
@@ -49,9 +49,10 @@ public void setPassword(String password) {
4949
}
5050

5151
public void setPasswordComparison(String passwordComparison) {
52+
this.pwError = true;
5253
this.passwordComparison = passwordComparison;
5354
if (passwordComparison != null) {
54-
this.pwError = passwordComparison.equals(this.password);
55+
this.pwError = !passwordComparison.equals(this.password);
5556
}
5657
}
5758

0 commit comments

Comments
 (0)