diff --git a/src/index.html b/src/index.html index aaa5fcd..5741c3b 100644 --- a/src/index.html +++ b/src/index.html @@ -1,73 +1,65 @@ - + Skynet Self Service - - -
- +
-

- Sign-up -

-

- Please use this if you have yet to activate an account on Skynet before. -

+

+ Sign-up +

+

+ Please use this if you have yet to activate an account on Skynet before. +

-

- Change Password -

-

- Please use this service to change your Skynet password. -

+

+ Change Password +

+

+ Please use this service to change your Skynet password +

-

- Account modification -

-

- Please use this service to modify your user data (email, login ssh key, etc.). -

+

+ Account modification +

+

+ Please use this service to modify your user data (email, login ssh key, etc.) +

-

- Forgot your username? -

-

- Please use this service to get a reminder email with your Skynet username. -

+

+ Forgot your username? +

+

+ Please use this service to get a reminder email with your Skynet username +

-

- Forgot your password? -

-

- Please use this service to reset your password. -

+

+ Forgot your password? +

+

+ Please use this service to reset your password. +

-
-

- SSH -

-

- Please use this service to manage your SSH keys. -

-
-
-
- + + + \ No newline at end of file diff --git a/src/js/lib.js b/src/js/lib.js new file mode 100644 index 0000000..2b585dd --- /dev/null +++ b/src/js/lib.js @@ -0,0 +1,28 @@ + + +export async function post_request(url, body, form_status){ + let req; + + try { + req = await fetch(url, { + method: 'POST', + body: JSON.stringify(body), + mode: "cors" + }); + } catch (e) { + form_status.innerHTML = `${e}`; + return; + } + + if (req.status !== 200) { + form_status.innerHTML = "Failure"; + return; + } + + let temp = await req.json(); + if (temp.result === 'error') { + form_status.innerHTML = `${temp.error}`; + } else { + form_status.innerHTML = "Success"; + } +} \ No newline at end of file diff --git a/src/modify.html b/src/modify.html index 6bf131a..2498418 100644 --- a/src/modify.html +++ b/src/modify.html @@ -3,13 +3,13 @@ Modify Account - - + +
@@ -17,7 +17,7 @@

Modify details of your Skynet account.

-
+ @@ -28,15 +28,14 @@ - + @@ -45,57 +44,12 @@ - +

- -

- +