Skip to content

Commit 9d62892

Browse files
committed
Add check for privacy confirmation.
1 parent ef246e3 commit 9d62892

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎wise-api/src/main/java/com/wisemapping/rest/UserController.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public void registerUser(@RequestBody RestUserRegistration registration, @NotNul
9191
throw new WiseMappingException("Registration is disabled. You can enable it using app.registration.enabled");
9292
}
9393

94+
if (!registration.isAcceptedTerms()) {
95+
throw new WiseMappingException("You must accept the Terms of Use and Privacy Policy to register.");
96+
}
97+
9498
if (registration.getPassword().length() < Account.MIN_PASSWORD_LENGTH_SIZE) {
9599
throw new PasswordTooShortException();
96100
}

‎wise-api/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class RestUserRegistration {
3636
private String lastname;
3737
private String password;
3838
private String recaptcha;
39+
private boolean acceptedTerms;
3940

4041
@JsonIgnore
4142
public Account build() {
@@ -75,4 +76,8 @@ public String getPassword() {
7576
public String getRecaptcha() {
7677
return recaptcha;
7778
}
79+
80+
public boolean isAcceptedTerms() {
81+
return acceptedTerms;
82+
}
7883
}

0 commit comments

Comments
 (0)