Gregniuki commited on
Commit
f6929f2
·
1 Parent(s): 47cfbd5

Update templates/register.html

Browse files
Files changed (1) hide show
  1. templates/register.html +29 -0
templates/register.html CHANGED
@@ -69,6 +69,35 @@
69
  // If fields are filled, form will proceed to submit
70
  // reCAPTCHA validation will be handled automatically by Google's script
71
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  </script>
73
  </body>
74
 
 
69
  // If fields are filled, form will proceed to submit
70
  // reCAPTCHA validation will be handled automatically by Google's script
71
  });
72
+ fetch('/register', {
73
+ method: 'POST',
74
+ headers: {
75
+ 'Content-Type': 'application/json'
76
+ },
77
+ body: JSON.stringify({
78
+ username: username,
79
+ email: email,
80
+ password: password,
81
+ confirm_password: confirmPassword,
82
+ recaptcha_token: token
83
+ })
84
+ })
85
+ .then(response => response.json())
86
+ .then(data => {
87
+ // Here you can handle the received data, including the access token and redirect URL
88
+ // For example:
89
+ storeAccessToken(data.access_token);
90
+ window.location.href = data.redirect_url;
91
+ })
92
+ .catch(error => {
93
+ console.error('Error:', error);
94
+ });
95
+ });
96
+
97
+ function storeAccessToken(token) {
98
+ // Implement your token storage logic here
99
+ console.log("Token stored:", token);
100
+ }
101
  </script>
102
  </body>
103