Update templates/register.html
Browse files- templates/register.html +20 -17
templates/register.html
CHANGED
@@ -69,28 +69,31 @@
|
|
69 |
// If fields are filled, form will proceed to submit
|
70 |
// reCAPTCHA validation will be handled automatically by Google's script
|
71 |
var formData = new FormData(this);
|
|
|
72 |
fetch('/register', {
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
.then(response =>
|
|
|
|
|
|
|
|
|
|
|
77 |
.then(data => {
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
})
|
83 |
.catch(error => {
|
84 |
-
|
85 |
-
});
|
86 |
});
|
|
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
console.log("Token stored:", token);
|
93 |
-
}
|
94 |
</script>
|
95 |
</body>
|
96 |
|
|
|
69 |
// If fields are filled, form will proceed to submit
|
70 |
// reCAPTCHA validation will be handled automatically by Google's script
|
71 |
var formData = new FormData(this);
|
72 |
+
|
73 |
fetch('/register', {
|
74 |
+
method: 'POST',
|
75 |
+
body: formData
|
76 |
+
})
|
77 |
+
.then(response => {
|
78 |
+
if (!response.ok) {
|
79 |
+
throw new Error('Network response was not ok ' + response.statusText);
|
80 |
+
}
|
81 |
+
return response.json();
|
82 |
+
})
|
83 |
.then(data => {
|
84 |
+
// Handle the received data
|
85 |
+
storeAccessToken(data.access_token);
|
86 |
+
window.location.href = data.redirect_url;
|
87 |
+
})
|
|
|
88 |
.catch(error => {
|
89 |
+
console.error('Error:', error);
|
|
|
90 |
});
|
91 |
+
});
|
92 |
|
93 |
+
function storeAccessToken(token) {
|
94 |
+
// Implement your token storage logic here
|
95 |
+
console.log("Token stored:", token);
|
96 |
+
}
|
|
|
|
|
97 |
</script>
|
98 |
</body>
|
99 |
|