Skip to content

Commit 3be86c9

Browse files
authored
Merge pull request #179 from docusign/fix/added-custom-error-to-examples
Added checks for email and user name for examples 20, 22 and 23
2 parents 1ef01eb + 26d676c commit 3be86c9

File tree

9 files changed

+46
-31
lines changed

9 files changed

+46
-31
lines changed

launcher-csharp/eSignature/Controllers/RecipientAuthIDV.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ public RecipientAuthIdv(DsConfiguration config, LauncherTexts launcherTexts, IRe
2727
[SetViewBag]
2828
public IActionResult Create(string signerEmail, string signerName, string ccEmail, string ccName)
2929
{
30+
if (signerEmail == this.Config.SignerEmail)
31+
{
32+
this.ViewBag.errorCode = "400";
33+
this.ViewBag.errorMessage = this.LauncherTexts.ManifestStructure.SupportingTexts.IdenticalEmailsNotAllowedErrorMessage;
34+
this.ViewBag.SupportingTexts = this.LauncherTexts.ManifestStructure.SupportingTexts;
35+
36+
return this.View("Error");
37+
}
38+
3039
try
3140
{
3241
// Check the token with minimal buffer time.

launcher-csharp/eSignature/Controllers/RecipientAuthKBA.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ public RecipientAuthKba(DsConfiguration config, LauncherTexts launcherTexts, IRe
2626
[SetViewBag]
2727
public IActionResult Create(string signerEmail, string signerName)
2828
{
29+
if (signerEmail == this.Config.SignerEmail)
30+
{
31+
this.ViewBag.errorCode = "400";
32+
this.ViewBag.errorMessage = this.LauncherTexts.ManifestStructure.SupportingTexts.IdenticalEmailsNotAllowedErrorMessage;
33+
this.ViewBag.SupportingTexts = this.LauncherTexts.ManifestStructure.SupportingTexts;
34+
35+
return this.View("Error");
36+
}
37+
2938
// Check the token with minimal buffer time.
3039
bool tokenOk = this.CheckToken(3);
3140
if (!tokenOk)

launcher-csharp/eSignature/Controllers/RecipientAuthPhone.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ public RecipientAuthPhone(DsConfiguration config, LauncherTexts launcherTexts, I
2727
[SetViewBag]
2828
public IActionResult Create(string signerEmail, string signerName, string signerCountryCode, string signerPhoneNumber)
2929
{
30+
if (signerEmail == this.Config.SignerEmail)
31+
{
32+
this.ViewBag.errorCode = "400";
33+
this.ViewBag.errorMessage = this.LauncherTexts.ManifestStructure.SupportingTexts.IdenticalEmailsNotAllowedErrorMessage;
34+
this.ViewBag.SupportingTexts = this.LauncherTexts.ManifestStructure.SupportingTexts;
35+
36+
return this.View("Error");
37+
}
38+
3039
try
3140
{
3241
// Check the token with minimal buffer time.

launcher-csharp/eSignature/Models/ModelsToReadManifest/SupportingTexts.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public class SupportingTexts
5050
[JsonProperty("ContactSupportToEnableFeature")]
5151
public string ContactSupportToEnableFeature { get; set; }
5252

53+
[JsonProperty("IdenticalEmailsNotAllowedErrorMessage")]
54+
public string IdenticalEmailsNotAllowedErrorMessage { get; set; }
55+
5356
[JsonProperty("LoginPage")]
5457
public LoginPage LoginPage { get; set; }
5558

launcher-csharp/eSignature/Views/Eg020SmsAuth/eg020.cshtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
name="signerEmail"
5252
aria-describedby="emailHelp"
5353
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[emailInputNumber].InputPlaceholder"
54-
required
55-
value="@ViewBag.Locals.DsConfig.SignerEmail">
54+
required>
5655

5756
<small id="emailHelp" class="form-text text-muted">
5857
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
@@ -68,7 +67,6 @@
6867
id="signerName"
6968
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[nameInputNumber].InputPlaceholder"
7069
name="signerName"
71-
value="@ViewBag.Locals.DsConfig.SignerName"
7270
required>
7371
</div>
7472

launcher-csharp/eSignature/Views/RecipientAuthIDV/eg023.cshtml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
</p>
2222

2323
<form class="eg" action="" method="post" data-busy="form">
24-
<p>@Html.Raw(ViewBag.CodeExampleText.Notes)</p>
25-
2624
<div class="form-group">
2725
<label for="signerEmail">
2826
@Html.Raw(ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputName)
@@ -34,8 +32,7 @@
3432
name="signerEmail"
3533
aria-describedby="emailHelp"
3634
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputPlaceholder"
37-
required
38-
value="@ViewBag.Locals.DsConfig.SignerEmail">
35+
required>
3936

4037
<small id="emailHelp" class="form-text text-muted">
4138
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
@@ -51,7 +48,6 @@
5148
id="signerName"
5249
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerNameInputNumber].InputPlaceholder"
5350
name="signerName"
54-
value="@ViewBag.Locals.DsConfig.SignerName"
5551
required />
5652
</div>
5753

launcher-csharp/eSignature/Views/RecipientAuthKBA/eg022.cshtml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
</p>
2222

2323
<form class="eg" action="" method="post" data-busy="form">
24-
<p>@Html.Raw(ViewBag.CodeExampleText.Notes)</p>
25-
2624
<div class="form-group">
2725
<label for="signerEmail">
2826
@Html.Raw(ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputName)
@@ -34,8 +32,7 @@
3432
name="signerEmail"
3533
aria-describedby="emailHelp"
3634
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputPlaceholder"
37-
required
38-
value="@ViewBag.Locals.DsConfig.SignerEmail">
35+
required>
3936
<small id="emailHelp" class="form-text text-muted">
4037
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
4138
</small>
@@ -50,7 +47,6 @@
5047
id="signerName"
5148
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerNameInputNumber].InputPlaceholder"
5249
name="signerName"
53-
value="@ViewBag.Locals.DsConfig.SignerName"
5450
required />
5551
</div>
5652
<input type="hidden" name="_csrf" value="<%- csrfToken %>">

launcher-csharp/eSignature/Views/RecipientAuthPhone/eg020.cshtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@
6565
name="signerEmail"
6666
aria-describedby="emailHelp"
6767
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputPlaceholder"
68-
required
69-
value="@ViewBag.Locals.DsConfig.SignerEmail">
68+
required>
7069

7170
<small id="emailHelp" class="form-text text-muted">
7271
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
@@ -81,7 +80,6 @@
8180
id="signerName"
8281
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerNameInputNumber].InputPlaceholder"
8382
name="signerName"
84-
value="@ViewBag.Locals.DsConfig.SignerName"
8583
required />
8684
</div>
8785
<input type="hidden" name="_csrf" value="<%- csrfToken %>">

manifest/CodeExamplesManifest.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"WelcomeText":"Welcome {0} (Account: {1})",
1515
"CFRError":"This example is not compatible with your CFR Part 11 account. Please return to the homepage to run one of the examples that is compatible or authenticate with a different account.",
1616
"ContactSupportToEnableFeature": "Please contact <a href=\"https://support.docusign.com/\">support</a> to enable {0} in your account",
17+
"IdenticalEmailsNotAllowedErrorMessage": "For recipient authentication you must specify a different recipient from the account owner (sender) in order to ensure recipient authentication is performed",
1718
"LoginPage":{
1819
"LoginHeader":"<h1 class='display-4'>Please Authenticate with Docusign</h1><label for='auth_type'>Please choose your authentication type</label>",
1920
"LoginButton":"Authenticate with Docusign",
@@ -187,7 +188,8 @@
187188
},
188189
{
189190
"InputName": "RSUs"
190-
} ]
191+
}
192+
]
191193
}
192194
],
193195
"ResultsPageText":"The envelope has been created and sent!<br />Envelope ID {0}."
@@ -1520,7 +1522,7 @@
15201522
"CFREnabled":"AllAccounts",
15211523
"ExampleName":"Send an envelope with ID Verification Authentication",
15221524
"ExampleDescription":"Submit an envelope that requires verification of a government issued identity.",
1523-
"Notes":"<p><b>Note:<b/> The access code for this example is the Signer Name.</p>",
1525+
"Notes":"<b>Note:</b> The access code for this example is the Signer Name.",
15241526
"LinksToAPIMethod":[
15251527
{
15261528
"Path":"https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/",
@@ -1554,7 +1556,7 @@
15541556
"CFREnabled":"AllAccounts",
15551557
"ExampleName":"Send an envelope with Recipient Knowledged Based Authentication",
15561558
"ExampleDescription":"Submit an envelope with multiple choice, public records based questions to provide multi-factor authentication.",
1557-
"Notes":"<p><b>Note:<b/> The access code for this example is the Signer Name.</p>",
1559+
"Notes":"<b>Note:</b> The access code for this example is the Signer Name.",
15581560
"LinksToAPIMethod":[
15591561
{
15601562
"Path":"https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/",
@@ -1886,7 +1888,7 @@
18861888
}
18871889
],
18881890
"ResultsPageText":"This value should match the value of your x-docusign-signature header: <br/>HMAC signature {0}",
1889-
"SkipForLanguages":"bash;powershell;java;php"
1891+
"SkipForLanguages":"bash;powershell"
18901892
}
18911893
]
18921894
}
@@ -1982,8 +1984,7 @@
19821984
"ErrorMessage":"<p>Problem: No active workflow found. Please create a new workflow and publish it on your <a href=\"https://apps-d.docusign.com/\">Docusign account page</a></p>"
19831985
}
19841986
],
1985-
"ResultsPageText": "Workflow instance is created. Please check your email to complete the workflow.",
1986-
"SkipForLanguages":"csharp;java;php;python;node;ruby"
1987+
"ResultsPageText": "Workflow instance is created. Please check your email to complete the workflow."
19871988
},
19881989
{
19891990
"ExampleNumber": 2,
@@ -2013,8 +2014,7 @@
20132014
"RedirectText": "<p>Error: No in progress workflow instance found, please <a {0}>trigger a workflow</a></p>"
20142015
}
20152016
],
2016-
"ResultsPageText": "Workflow instance {0} was canceled.",
2017-
"SkipForLanguages":"csharp;java;php;python;node;ruby"
2017+
"ResultsPageText": "Workflow instance {0} was canceled."
20182018
},
20192019
{
20202020
"ExampleNumber": 3,
@@ -2044,8 +2044,7 @@
20442044
"RedirectText": "<p>Error: No workflow instance found, please <a {0}>trigger a workflow</a></p>"
20452045
}
20462046
],
2047-
"ResultsPageText": "Workflow instance state: {0}",
2048-
"SkipForLanguages":"csharp;java;php;python;node;ruby"
2047+
"ResultsPageText": "Workflow instance state: {0}"
20492048
}
20502049
]
20512050
}
@@ -2714,8 +2713,7 @@
27142713
]
27152714
}
27162715
],
2717-
"ResultsPageText":"Results from DataDeletion:redactIndividualMembershipData method:",
2718-
"SkipForLanguages":"java"
2716+
"ResultsPageText":"Results from DataDeletion:redactIndividualMembershipData method:"
27192717
},
27202718
{
27212719
"ExampleNumber":11,
@@ -2737,8 +2735,7 @@
27372735
]
27382736
}
27392737
],
2740-
"ResultsPageText":"Results from DataDeletion:redactIndividualUserData method:",
2741-
"SkipForLanguages":"java"
2738+
"ResultsPageText":"Results from DataDeletion:redactIndividualUserData method:"
27422739
},
27432740
{
27442741
"ExampleNumber":12,
@@ -2786,4 +2783,4 @@
27862783
]
27872784
}
27882785
]
2789-
}
2786+
}

0 commit comments

Comments
 (0)