//2025-11-01 Google dropping support for captcha, just nuking it for now, see how much spam I get
This commit is contained in:
@@ -65,8 +65,7 @@
|
||||
<div class="form-group">
|
||||
<label asp-for="Contact.DbId" class="col-md-3 right">DbId:</label>
|
||||
<div class="col-md-9">
|
||||
<input asp-for="Contact.DbId" placeholder="AyaNova Database Id (optional)" class="form-control"
|
||||
required />
|
||||
<input asp-for="Contact.DbId" placeholder="AyaNova Database Id (optional)" class="form-control" required />
|
||||
<span asp-validation-for="Contact.DbId"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,7 +98,7 @@
|
||||
|
||||
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
|
||||
<label class="col-md-4 control-label" for="Send"></label>
|
||||
<div class="col-md-4">
|
||||
@@ -107,12 +106,20 @@
|
||||
</div>
|
||||
<button id="btnsubmit" type="submit" class="btn btn-info">Send us your question</button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-md-4 control-label" for="Send"></label>
|
||||
<div class="col-md-4">
|
||||
|
||||
<button type="submit" class="btn btn-info">Send us your question</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<button type="submit">Send</button>
|
||||
<button type="submit">Send us your question</button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div> -->
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
@@ -170,7 +177,7 @@
|
||||
<div class="container text-center">
|
||||
<div class="row">
|
||||
<hr>
|
||||
<small><span>Ground Zero Tech-Works Inc., 05 - 3610 Christie Parkway Courtenay, BC V9N 9T6 Canada</span>
|
||||
<small><span>Ground Zero Tech-Works Inc., British Columbia, Canada</span>
|
||||
<br>
|
||||
<span>Since 1999 AyaNova® is a registered trademark of Ground Zero Tech-Works Inc. in the United States and
|
||||
other countries.</span>
|
||||
|
||||
@@ -51,14 +51,15 @@ namespace contact.Pages
|
||||
}
|
||||
|
||||
|
||||
if (!ReCaptchaPassed(
|
||||
Request.Form["g-recaptcha-response"], // that's how you get it from the Request object
|
||||
_configuration.GetSection("GoogleReCaptcha:secret").Value
|
||||
))
|
||||
{
|
||||
//Return a fail code that will hopefully take us off the spammers list
|
||||
return StatusCode(500);
|
||||
}
|
||||
//2025-11-01 Google dropping support for captcha, just nuking it for now, see how much spam I get
|
||||
// if (!ReCaptchaPassed(
|
||||
// Request.Form["g-recaptcha-response"], // that's how you get it from the Request object
|
||||
// _configuration.GetSection("GoogleReCaptcha:secret").Value
|
||||
// ))
|
||||
// {
|
||||
// //Return a fail code that will hopefully take us off the spammers list
|
||||
// return StatusCode(500);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -166,26 +167,26 @@ namespace contact.Pages
|
||||
}
|
||||
|
||||
|
||||
//2025-11-01 Google dropping support for captcha, just nuking it for now, see how much spam I get
|
||||
// public static bool ReCaptchaPassed(string gRecaptchaResponse, string secret)
|
||||
// {
|
||||
// HttpClient httpClient = new HttpClient();
|
||||
// var res = httpClient.GetAsync($"https://www.google.com/recaptcha/api/siteverify?secret={secret}&response={gRecaptchaResponse}").Result;
|
||||
// if (res.StatusCode != HttpStatusCode.OK)
|
||||
// {
|
||||
// // logger.LogError("Error while sending request to ReCaptcha");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
public static bool ReCaptchaPassed(string gRecaptchaResponse, string secret)
|
||||
{
|
||||
HttpClient httpClient = new HttpClient();
|
||||
var res = httpClient.GetAsync($"https://www.google.com/recaptcha/api/siteverify?secret={secret}&response={gRecaptchaResponse}").Result;
|
||||
if (res.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
// logger.LogError("Error while sending request to ReCaptcha");
|
||||
return false;
|
||||
}
|
||||
// string JSONres = res.Content.ReadAsStringAsync().Result;
|
||||
// dynamic JSONdata = JObject.Parse(JSONres);
|
||||
// if (JSONdata.success != "true")
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
string JSONres = res.Content.ReadAsStringAsync().Result;
|
||||
dynamic JSONdata = JObject.Parse(JSONres);
|
||||
if (JSONdata.success != "true")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
|
||||
<!-- Button -->
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
|
||||
<label class="col-md-4 control-label" for="Send"></label>
|
||||
<div class="col-md-4">
|
||||
@@ -78,6 +78,13 @@
|
||||
<button id="btnsubmit" type="submit" class="btn btn-info">Send us your request</button>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-md-4 control-label" for="Send"></label>
|
||||
<div class="col-md-4">
|
||||
<button type="submit" class="btn btn-info">Send us your request</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -89,7 +96,7 @@
|
||||
<div class="container text-center">
|
||||
<div class="row">
|
||||
<hr>
|
||||
<small><span> © 2022 Ground Zero Tech-Works, Inc</span>
|
||||
<small><span>Ground Zero Tech-Works, Inc</span>
|
||||
|
||||
<br>
|
||||
<span><a href="https://ayanova.com/r/privacy.htm">Privacy Policy</a></span></small>
|
||||
|
||||
@@ -67,15 +67,15 @@ namespace contact.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
|
||||
if (!ReCaptchaPassed(
|
||||
Request.Form["g-recaptcha-response"], // that's how you get it from the Request object
|
||||
_configuration.GetSection("GoogleReCaptcha:secret").Value
|
||||
))
|
||||
{
|
||||
//Return a fail code that will hopefully take us off the spammers list
|
||||
return StatusCode(500);
|
||||
}
|
||||
//2025-11-01 Google dropping support for captcha, just nuking it for now, see how much spam I get
|
||||
// if (!ReCaptchaPassed(
|
||||
// Request.Form["g-recaptcha-response"], // that's how you get it from the Request object
|
||||
// _configuration.GetSection("GoogleReCaptcha:secret").Value
|
||||
// ))
|
||||
// {
|
||||
// //Return a fail code that will hopefully take us off the spammers list
|
||||
// return StatusCode(500);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace contact.Pages
|
||||
System.Text.Encoding.UTF8,
|
||||
"application/json");
|
||||
var response = client.PostAsync("https://sockeye.ayanova.com/subscription-server-trial-request", body).Result;
|
||||
//var response = client.PostAsync("http://localhost:7676/subscription-server-trial-request", body).Result;
|
||||
//var response = client.PostAsync("http://localhost:7676/subscription-server-trial-request", body).Result;
|
||||
|
||||
// if (response.IsSuccessStatusCode)
|
||||
// {
|
||||
@@ -202,26 +202,26 @@ namespace contact.Pages
|
||||
}
|
||||
|
||||
|
||||
//2025-11-01 Google dropping support for captcha, just nuking it for now, see how much spam I get
|
||||
// public static bool ReCaptchaPassed(string gRecaptchaResponse, string secret)
|
||||
// {
|
||||
// HttpClient httpClient = new HttpClient();
|
||||
// var res = httpClient.GetAsync($"https://www.google.com/recaptcha/api/siteverify?secret={secret}&response={gRecaptchaResponse}").Result;
|
||||
// if (res.StatusCode != HttpStatusCode.OK)
|
||||
// {
|
||||
// // logger.LogError("Error while sending request to ReCaptcha");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
public static bool ReCaptchaPassed(string gRecaptchaResponse, string secret)
|
||||
{
|
||||
HttpClient httpClient = new HttpClient();
|
||||
var res = httpClient.GetAsync($"https://www.google.com/recaptcha/api/siteverify?secret={secret}&response={gRecaptchaResponse}").Result;
|
||||
if (res.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
// logger.LogError("Error while sending request to ReCaptcha");
|
||||
return false;
|
||||
}
|
||||
// string JSONres = res.Content.ReadAsStringAsync().Result;
|
||||
// dynamic JSONdata = JObject.Parse(JSONres);
|
||||
// if (JSONdata.success != "true")
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
string JSONres = res.Content.ReadAsStringAsync().Result;
|
||||
dynamic JSONdata = JObject.Parse(JSONres);
|
||||
if (JSONdata.success != "true")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user