diff --git a/src/register.html b/src/register.html index 8064af1..ff25e61 100644 --- a/src/register.html +++ b/src/register.html @@ -8,8 +8,6 @@

Sign-up

- -

@@ -27,10 +25,12 @@ function formHandler(listener){ listener.preventDefault(); 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 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', { method: 'POST', body: JSON.stringify(object), @@ -53,7 +53,7 @@ } } }) - .catch(() => document.getElementById('formStatus').innerHTML = "Please try again") + .catch(() => document.getElementById('formStatus').innerHTML = "Please try again"); }