Skip to content

Commit 78357e1

Browse files
authored
Add recaptcha to the forgot password page (#8849)
1 parent 4f257b8 commit 78357e1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/NuGetGallery/Controllers/UsersController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ public virtual ActionResult ForgotPassword()
624624

625625
[HttpPost]
626626
[ValidateAntiForgeryToken]
627+
[ValidateRecaptchaResponse]
627628
public virtual async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model)
628629
{
629630
// We don't want Login to have us as a return URL

src/NuGetGallery/Views/Users/ForgotPassword.cshtml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@
3333
@Html.ShowValidationMessagesForEmpty()
3434
</div>
3535
<div class="form-group">
36-
<input type="submit" class="btn btn-primary form-control" value="Send" />
36+
<input id="Submit" type="submit" class="btn btn-primary form-control" value="Send" />
3737
</div>
3838
}
3939
</div>
4040
</div>
4141
</div>
42-
</section>
42+
</section>
43+
44+
@section BottomScripts {
45+
@ViewHelpers.RecaptchaScripts(Config.Current.ReCaptchaPublicKey, "Submit")
46+
}

0 commit comments

Comments
 (0)