Skip to content

Commit d1720b0

Browse files
authored
Merge pull request #189 from akvamalin/add-password-change-ticket-mark-email-as-verified-property
Add "mark_email_as_verified" property to PasswordChangeTicket
2 parents 0f3e7a9 + 3d68676 commit d1720b0

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/main/java/com/auth0/json/mgmt/tickets/PasswordChangeTicket.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class PasswordChangeTicket {
2828
private String email;
2929
@JsonProperty("ticket")
3030
private String ticket;
31+
@JsonProperty("mark_email_as_verified")
32+
private Boolean markEmailAsVerified;
3133

3234
@JsonCreator
3335
public PasswordChangeTicket(@JsonProperty("user_id") String userId) {
@@ -99,6 +101,16 @@ public void setEmail(String email) {
99101
this.email = email;
100102
}
101103

104+
/**
105+
* Setter for the mark_email_as_verified to define if user.email_verified should be set to true after ticket is consumed.
106+
*
107+
* @param markEmailAsVerified true if email_verified attribute must be set to true once password is changed, false if email_verified attribute should not be updated.
108+
*/
109+
@JsonProperty("mark_email_as_verified")
110+
public void setMarkEmailAsVerified(Boolean markEmailAsVerified){
111+
this.markEmailAsVerified = markEmailAsVerified;
112+
}
113+
102114
/**
103115
* Getter for the ticket url.
104116
*

src/test/java/com/auth0/json/mgmt/tickets/PasswordChangeTicketTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public void shouldSerialize() throws Exception {
2020
ticket.setConnectionId("12");
2121
ticket.setEmail("me@auth0.com");
2222
ticket.setNewPassword("pass123");
23+
ticket.setMarkEmailAsVerified(true);
2324

2425
String serialized = toJSON(ticket);
2526
assertThat(serialized, is(notNullValue()));
@@ -29,6 +30,7 @@ public void shouldSerialize() throws Exception {
2930
assertThat(serialized, JsonMatcher.hasEntry("new_password", "pass123"));
3031
assertThat(serialized, JsonMatcher.hasEntry("connection_id", "12"));
3132
assertThat(serialized, JsonMatcher.hasEntry("email", "me@auth0.com"));
33+
assertThat(serialized, JsonMatcher.hasEntry("mark_email_as_verified", true));
3234
}
3335

3436
@Test

0 commit comments

Comments
 (0)