[Email Change] PEBCAK edited wrong files

#1
This commit is contained in:
eoghan.conlon 2023-07-29 22:39:12 +01:00
parent f3d51c205d
commit 0f557ab420
4 changed files with 16 additions and 16 deletions

View file

@ -6,9 +6,9 @@ function formHandler(listener){
const formData = new FormData(formEl);
const user = formData.get("user");
const pass = formData.get("pass");
const newPW = formData.get("newPW");
if(newPW === formData.get("newPWConfirm")){
const object = {user: user, pass: pass, field: "userPassword", value: newPW}
const newEmail = formData.get("newEmail");
if(newEmail === formData.get("newEmail2")){
const object = {user: user, pass: pass, field: "mail", value: newEmail}
fetch('https://api.sso.skynet.ie/ldap/update', {
method: 'POST',
body: JSON.stringify(object)

View file

@ -9,12 +9,12 @@
<form id="reset">
<label for="user">Username</label>
<input type="text" id="user" name="user" /> <br />
<label for="pass">Old Password</label>
<label for="pass">Password</label>
<input type="password" id="pass" name="pass" /> <br />
<label for="newPW1">New Password</label>
<input type="password" id="newPW1" name="newPW" /> <br />
<label for="newPW2">Confirm</label>
<input type="password" id="newPW2" name="newPWConfirm" /> <br />
<label for="newEmail">New email</label>
<input type="email" id="newEmail" name="newPW" /> <br />
<label for="newEmail2">Confirm</label>
<input type="email" id="newEmail2" name="newPWConfirm" /> <br />
<input type="Submit" value="Submit" />
</form>
<p id="formStatus"></p>

View file

@ -6,9 +6,9 @@ function formHandler(listener){
const formData = new FormData(formEl);
const user = formData.get("user");
const pass = formData.get("pass");
const newEmail = formData.get("newEmail");
if(newEmail === formData.get("newEmail2")){
const object = {user: user, pass: pass, field: "mail", value: newEmail}
const newPW = formData.get("newPW");
if(newPW === formData.get("newPWConfirm")){
const object = {user: user, pass: pass, field: "userPassword", value: newPW}
fetch('https://api.sso.skynet.ie/ldap/update', {
method: 'POST',
body: JSON.stringify(object)

View file

@ -9,12 +9,12 @@
<form id="reset">
<label for="user">Username</label>
<input type="text" id="user" name="user" /> <br />
<label for="pass">Password</label>
<label for="pass">Old Password</label>
<input type="password" id="pass" name="pass" /> <br />
<label for="newEmail">New email</label>
<input type="email" id="newEmail" name="newPW" /> <br />
<label for="newEmail2">Confirm</label>
<input type="email" id="newEmail2" name="newPWConfirm" /> <br />
<label for="newPW1">New Password</label>
<input type="password" id="newPW1" name="newPW" /> <br />
<label for="newPW2">Confirm</label>
<input type="password" id="newPW2" name="newPWConfirm" /> <br />
<input type="Submit" value="Submit" />
</form>
<p id="formStatus"></p>