From 20e284fb135b85b709bdfa9eb22d965a2d65036d Mon Sep 17 00:00:00 2001 From: "eoghan.conlon" Date: Sat, 5 Aug 2023 16:39:02 +0100 Subject: [PATCH] Feat. Auth is taken directly from the URL, auth on form removed #3 --- src/register.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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"); }