From 05b05833f6d726810d777ae96e9fef56cac68a49 Mon Sep 17 00:00:00 2001 From: Eoghan Conlon Date: Sun, 27 Aug 2023 17:00:40 +0100 Subject: [PATCH] Result status handling complete Signed-off-by: Eoghan Conlon --- src/recovery/reset.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/recovery/reset.html b/src/recovery/reset.html index 535d88e..f4734cd 100644 --- a/src/recovery/reset.html +++ b/src/recovery/reset.html @@ -38,6 +38,14 @@ method: 'POST', body: JSON.stringify(object), mode: "cors" + }).then(res => { + if(res.status === 200){ + return res.json(); + } else if (res.status === 500){ + document.getElementById('formStatus').innerHTML = "Failure"; + } else { + document.getElementById('formStatus').innerHTML = "Failure: Failed to communicate to server"; + } }) } else { document.getElementById('formStatus').innerHTML = "Failure: Passwords don't match";