parent
4a1fb8481b
commit
20e284fb13
1 changed files with 5 additions and 5 deletions
|
@ -8,8 +8,6 @@
|
||||||
<body>
|
<body>
|
||||||
<h1>Sign-up</h1>
|
<h1>Sign-up</h1>
|
||||||
<form id="register">
|
<form id="register">
|
||||||
<label for="auth">Auth code</label>
|
|
||||||
<input type="text" id="auth" name="auth" /> <br/>
|
|
||||||
<label for="user">Username</label>
|
<label for="user">Username</label>
|
||||||
<input type="text" id="user" name="user" /> <br />
|
<input type="text" id="user" name="user" /> <br />
|
||||||
<label for="pass">Password</label>
|
<label for="pass">Password</label>
|
||||||
|
@ -27,10 +25,12 @@
|
||||||
function formHandler(listener){
|
function formHandler(listener){
|
||||||
listener.preventDefault();
|
listener.preventDefault();
|
||||||
const formData = new FormData(formEl);
|
const formData = new FormData(formEl);
|
||||||
const auth = formData.get("auth");
|
const url = new URL(window.location.href);
|
||||||
|
const urlParam = new URLSearchParams(url.search);
|
||||||
|
const auth = urlParam.get("auth");
|
||||||
const user = formData.get("user");
|
const user = formData.get("user");
|
||||||
const pass = formData.get("pass");
|
const pass = formData.get("pass");
|
||||||
const object = { auth: auth, user: user, pass: pass }
|
const object = { auth: auth, user: user, pass: pass };
|
||||||
fetch('https://api.sso.skynet.ie/ldap/new', {
|
fetch('https://api.sso.skynet.ie/ldap/new', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(object),
|
body: JSON.stringify(object),
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => document.getElementById('formStatus').innerHTML = "<span style='background-color: yellow; color: black'>Please try again</span>")
|
.catch(() => document.getElementById('formStatus').innerHTML = "<span style='background-color: yellow; color: black'>Please try again</span>");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in a new issue