Skip to content

Commit 57c22bc

Browse files
Update sdb6chat1.html
1 parent a3a7b68 commit 57c22bc

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

1ShreeRam/sdb6chat1.html

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@
88

99
<h1> In APP Web Client for TestCaptcha miaw2 sdb6 Deployment</h1>
1010
<p><a id="editThisPageLink" target="_blank" style="color:blue">Edit this pages</a></p>
11-
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
11+
<script src="https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit" async defer></script>
12+
<script>
13+
document.getElementById('editThisPageLink').href =
14+
"https://github.com/shreerammohanty/miawtest/edit/master/1ShreeRam/LocalSdb6Connect.html";
15+
16+
let recaptchaWidgetId = null;
17+
18+
function onRecaptchaLoad() {
19+
recaptchaWidgetId = grecaptcha.render('recaptcha-container', {
20+
sitekey: '6Lfy2HMrAAAAAIVf2zhrlxQ-6ht07tNdfNUrD3p9',
21+
size: 'invisible',
22+
callback: onVerify,
23+
'error-callback': onError,
24+
'expired-callback': onExpired
25+
});
26+
27+
// Execute immediately, no button required
28+
grecaptcha.execute(recaptchaWidgetId);
29+
}
30+
31+
function onVerify(token) {
32+
console.log('reCAPTCHA token:', token);
33+
// TODO: POST the token to your backend for verification
34+
// fetch('/verify', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ token }) });
35+
}
36+
37+
function onError() {
38+
console.error('reCAPTCHA error');
39+
}
40+
41+
function onExpired() {
42+
console.warn('reCAPTCHA expired, re-executing…');
43+
grecaptcha.execute(recaptchaWidgetId);
44+
}
45+
</script>
1246
<script>document.getElementById('editThisPageLink').href = "https://github.com/shreerammohanty/miawtest/edit/master/1ShreeRam/sdb6chat1.html";</script>
1347

1448

0 commit comments

Comments
 (0)