Update templates/register.html
Browse files- templates/register.html +16 -13
templates/register.html
CHANGED
@@ -5,17 +5,11 @@
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Register</title>
|
7 |
<link rel="stylesheet" type="text/css" href="style.css"> <!-- Add this line for your CSS -->
|
8 |
-
|
9 |
-
<script>
|
10 |
-
function onSubmit(token) {
|
11 |
-
document.getElementById('recaptcha_token').value = token;
|
12 |
-
document.getElementById('registration-form').submit();
|
13 |
-
}
|
14 |
-
</script>
|
15 |
</head>
|
16 |
<body>
|
17 |
<h1>Register</h1>
|
18 |
-
<form action="/register" method="post" id="registration-form">
|
19 |
<label for="username">Username:</label>
|
20 |
<input type="text" id="username" name="username" required><br><br>
|
21 |
|
@@ -30,11 +24,20 @@
|
|
30 |
|
31 |
<!-- Hidden field for the reCAPTCHA token -->
|
32 |
<input type="hidden" id="recaptcha_token" name="recaptcha_token" value="">
|
33 |
-
<button
|
34 |
-
data-sitekey="6LdMjQcpAAAAAGtbNZkL17ry1scsQjp1HSEhkLNl"
|
35 |
-
data-callback='onSubmit'
|
36 |
-
data-action='submit'>Register</button>
|
37 |
</form>
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
</body>
|
40 |
</html>
|
|
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Register</title>
|
7 |
<link rel="stylesheet" type="text/css" href="style.css"> <!-- Add this line for your CSS -->
|
8 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
</head>
|
10 |
<body>
|
11 |
<h1>Register</h1>
|
12 |
+
<form action="/register" method="post" id="registration-form" onsubmit="event.preventDefault(); grecaptcha.execute();">
|
13 |
<label for="username">Username:</label>
|
14 |
<input type="text" id="username" name="username" required><br><br>
|
15 |
|
|
|
24 |
|
25 |
<!-- Hidden field for the reCAPTCHA token -->
|
26 |
<input type="hidden" id="recaptcha_token" name="recaptcha_token" value="">
|
27 |
+
<button type="submit">Register</button>
|
|
|
|
|
|
|
28 |
</form>
|
29 |
+
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
30 |
+
<script>
|
31 |
+
function onSubmit(token) {
|
32 |
+
document.getElementById('recaptcha_token').value = token;
|
33 |
+
document.getElementById('registration-form').submit();
|
34 |
+
}
|
35 |
+
|
36 |
+
grecaptcha.ready(function() {
|
37 |
+
grecaptcha.execute('6LdMjQcpAAAAAGtbNZkL17ry1scsQjp1HSEhkLNl', {action: 'submit'}).then(function(token) {
|
38 |
+
onSubmit(token);
|
39 |
+
});
|
40 |
+
});
|
41 |
+
</script>
|
42 |
</body>
|
43 |
</html>
|