[Email Change] Refactoring script and html form for email rather than password
#1
This commit is contained in:
parent
693acc7946
commit
f3d51c205d
2 changed files with 8 additions and 8 deletions
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue