Skip to content

Commit 0c93e1e

Browse files
committed
Added checks for email and user name for examples 20, 22 and 23
1 parent 899c7e8 commit 0c93e1e

File tree

7 files changed

+17
-9
lines changed

7 files changed

+17
-9
lines changed

src/main/java/com/docusign/controller/eSignature/examples/EG020ControllerPhoneAuthentication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ protected void onInitModel(WorkArguments args, ModelMap model) throws Exception
5050
@Override
5151
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response)
5252
throws ApiException, IOException {
53+
if (args.getSignerEmail().equals(config.getSignerEmail())) {
54+
throw new ApiException(config.getCodeExamplesText().SupportingTexts.RecipientShouldDifferFromSender);
55+
}
56+
5357
String accountId = session.getAccountId();
5458

5559
ApiClient apiClient = createApiClient(session.getBasePath(), user.getAccessToken());

src/main/java/com/docusign/controller/eSignature/examples/EG022ControllerKBAAuthentication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public EG022ControllerKBAAuthentication(DSConfiguration config, Session session,
3333
// ***DS.snippet.0.start
3434
protected Object doWork(WorkArguments args, ModelMap model,
3535
HttpServletResponse response) throws ApiException, IOException {
36+
if (args.getSignerEmail().equals(config.getSignerEmail())) {
37+
throw new ApiException(config.getCodeExamplesText().SupportingTexts.RecipientShouldDifferFromSender);
38+
}
39+
3640
// Step 1: Construct your API headers
3741
EnvelopesApi envelopesApi = createEnvelopesApi(session.getBasePath(), user.getAccessToken());
3842

src/main/java/com/docusign/controller/eSignature/examples/EG023ControllerIdvAuthentication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public EG023ControllerIdvAuthentication(DSConfiguration config, Session session,
3535

3636
@Override
3737
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response) throws ApiException, IOException {
38+
if (args.getSignerEmail().equals(config.getSignerEmail())) {
39+
throw new ApiException(config.getCodeExamplesText().SupportingTexts.RecipientShouldDifferFromSender);
40+
}
41+
3842
ApiClient apiClient = createApiClient(session.getBasePath(), user.getAccessToken());
3943
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
4044
String workflowId = IdvAuthenticationService.retrieveWorkflowId(apiClient, session.getAccountId());

src/main/java/com/docusign/core/model/manifestModels/SupportingTexts.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class SupportingTexts {
3434

3535
public String CFRError;
3636

37+
public String RecipientShouldDifferFromSender;
38+
3739
public LoginPage LoginPage;
3840

3941
public SelectAPIPage SelectAPIPage;

src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg020.jsp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
name="signerEmail"
6363
aria-describedby="emailHelp"
6464
placeholder="${example.getForms().get(formNumber).getInputs().get(signerEmailInputNumber).getInputPlaceholder()}"
65-
required
66-
value="${locals.dsConfig.signerEmail}">
65+
required>
6766

6867
<small id="emailHelp" class="form-text text-muted">
6968
${launcherTexts.getHelpingTexts().getEmailWontBeShared()}
@@ -79,7 +78,6 @@
7978
id="signerName"
8079
placeholder="${example.getForms().get(formNumber).getInputs().get(signerNameInputNumber).getInputPlaceholder()}"
8180
name="signerName"
82-
value="${locals.dsConfig.signerName}"
8381
required>
8482
</div>
8583
<input type="hidden" name="_csrf" value="${csrfToken}">

src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg022.jsp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
name="signerEmail"
3333
aria-describedby="emailHelp"
3434
placeholder="${example.getForms().get(formNumber).getInputs().get(signerEmailInputNumber).getInputPlaceholder()}"
35-
required
36-
value="${locals.dsConfig.signerEmail}">
35+
required>
3736

3837
<small id="emailHelp" class="form-text text-muted">
3938
${launcherTexts.getHelpingTexts().getEmailWontBeShared()}
@@ -49,7 +48,6 @@
4948
id="signerName"
5049
placeholder="${example.getForms().get(formNumber).getInputs().get(signerNameInputNumber).getInputPlaceholder()}"
5150
name="signerName"
52-
value="${locals.dsConfig.signerName}"
5351
required>
5452
</div>
5553
<input type="hidden" name="_csrf" value="${csrfToken}">

src/main/webapp/WEB-INF/templates/views/pages/esignature/examples/eg023.jsp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
name="signerEmail"
3232
aria-describedby="emailHelp"
3333
placeholder="${example.getForms().get(formNumber).getInputs().get(signerEmailInputNumber).getInputPlaceholder()}"
34-
required
35-
value="${locals.dsConfig.signerEmail}">
34+
required>
3635

3736
<small id="emailHelp" class="form-text text-muted">
3837
${launcherTexts.getHelpingTexts().getEmailWontBeShared()}
@@ -48,7 +47,6 @@
4847
id="signerName"
4948
placeholder="${example.getForms().get(formNumber).getInputs().get(signerNameInputNumber).getInputPlaceholder()}"
5049
name="signerName"
51-
value="${locals.dsConfig.signerName}"
5250
required>
5351
</div>
5452
<input type="hidden" name="_csrf" value="${csrfToken}">

0 commit comments

Comments
 (0)