Update register.html

This commit is contained in:
xfarrow 2023-10-18 15:02:34 +02:00
parent 37aa4268b4
commit 0cb7adef30

View File

@ -2,7 +2,7 @@
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>HTML5 Login Form with validation Example</title>
<title>Sign Up to Blink</title>
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> -->
<link rel="stylesheet" href="../css/login-register.css">
<script src=""></script>
@ -35,6 +35,7 @@
</div>
<script>
function register(){
const display_name = document.getElementById("displayname").value;
const email = document.getElementById("email").value;
@ -51,16 +52,16 @@
},
body: JSON.stringify({ display_name, email, password }),
};
alert(JSON.stringify({ display_name, email, password }));
fetch('http://localhost:3000/blinkapi/register', options)
.then(response => {
if (response.ok) {
alert('You successfully registered an account')
alert("Congratulations! You've successfully registered to Blink. Please click on the e-mail we sent you to confirm your account");
// Redirect to a different page on the same domain using a relative path
window.location.href = '/newpage.html';
}
})
.catch(err => {
console.error(err);
alert("An error has occurred. Try again later");
});
}
</script>