Fixed bugs, put key to html form
This commit is contained in:
@@ -47,8 +47,8 @@ app.controller("applicationController", function($scope, $http, $location, $wind
|
||||
var valid;
|
||||
//server side validation
|
||||
$scope.member.reCaptchaResponse = vcRecaptchaService.getResponse()
|
||||
if(resp === "") {
|
||||
alert("Ole hyvä ja täytä kuvavarmennus");
|
||||
if($scope.member.reCaptchaResponse === "") {
|
||||
notyError("Ole hyvä ja täytä kuvavarmennus");
|
||||
} else {
|
||||
$http.post("/members/api/request", $scope.member).then(function(data){
|
||||
notySuccess("Hakemus lähetetty!");
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<div
|
||||
vc-recaptcha
|
||||
theme="'light'"
|
||||
key="model.key"
|
||||
key="6LevHAcUAAAAAA45B7c-7qja-2aSwHztr9xb4K2Z"
|
||||
on-create="setWidgetId(widgetId)"
|
||||
on-success="setResponse(response)"
|
||||
on-expire="cbExpiration()"
|
||||
|
||||
+4
-2
@@ -17,9 +17,11 @@ def validateReCaptcha(response):
|
||||
'response': response,
|
||||
}
|
||||
url = "https://www.google.com/recaptcha/api/siteverify"
|
||||
headers = {'Content-type': 'application/json'}
|
||||
headers = {'Content-type': 'application/json'}
|
||||
resp = requests.post(url, data=json.dumps(values), headers=headers)
|
||||
result = json.loads(resp.read())
|
||||
result = json.loads(resp.text)
|
||||
print(resp.text)
|
||||
print(values)
|
||||
if not result["success"]:
|
||||
return False
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user