From ddac23677864aaec8c2db1ca2653f0b81d406ab2 Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 18 Jul 2021 09:39:55 -0700 Subject: [PATCH] Removed api url --- login.js | 5 ++--- loginchange.js | 5 ++--- register.js | 5 ++--- style.css | 8 +++++++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/login.js b/login.js index 20a3dcd..258ed71 100644 --- a/login.js +++ b/login.js @@ -1,8 +1,6 @@ let uname = document.querySelector('#uname').value; // grabbing the username submitted and putting it in the variable uname let pin = document.querySelector('#pin').value; // grabbing the pin submitted and putting it in the variable pin const form = document.querySelector('form'); // grabbing an element on the page -const API_URL = `http://127.0.0.1:8000` - form.addEventListener("submit", async function(event) { event.preventDefault(); @@ -25,7 +23,8 @@ form.addEventListener("submit", async function(event) { }) async function loginFetch() { - const rawResponse = await fetch(`${API_URL}/api/users/${uname}/${pin}`, { + const rawResponse = await fetch(`/api/users/${uname}/${pin}`, { + // credentials: "include", method: 'GET', headers: { 'Accept': 'text/plain' diff --git a/loginchange.js b/loginchange.js index 956a58f..466beb2 100644 --- a/loginchange.js +++ b/loginchange.js @@ -7,7 +7,6 @@ let newPin = document.querySelector('#newpin').value; // let pronouns = '' let responseText; const form = document.querySelector('form'); -const API_URL = `http://127.0.0.1:8000` form.addEventListener("submit", async function(event) { event.preventDefault(); @@ -47,13 +46,13 @@ form.addEventListener("submit", async function(event) { }) async function getUname() { - let response = await fetch(`${API_URL}/api/users/${uname}`); + let response = await fetch(`/api/users/${uname}`); responseText = await response.text(); return responseText; } async function loginChange() { -const rawResponse = await fetch(`${API_URL}/api/users/change/${uname}/${pin}/${newUname}/${newPin}`, { +const rawResponse = await fetch(`/api/users/change/${uname}/${pin}/${newUname}/${newPin}`, { method: 'POST', headers: { 'Accept': 'text/plain' diff --git a/register.js b/register.js index 246c9da..fa9f3d6 100644 --- a/register.js +++ b/register.js @@ -5,7 +5,6 @@ let custom = document.querySelector('#custom').value; let pronouns = '' let responseText; const form = document.querySelector('form'); // grabbing an element on the page -const API_URL = `http://127.0.0.1:8000` form.addEventListener("submit", async function(event) { event.preventDefault(); @@ -37,13 +36,13 @@ form.addEventListener("submit", async function(event) { }) async function getUname() { - let response = await fetch(`${API_URL}/api/users/${uname}`); + let response = await fetch(`$/api/users/${uname}`); responseText = await response.text(); return responseText; } async function register() { -const rawResponse = await fetch(`${API_URL}/api/register/${uname.toString().toLowerCase()}/${pin.toString()}/${pronouns.toString().toLowerCase().replace("/", ".")}`, { +const rawResponse = await fetch(`/api/register/${uname.toString().toLowerCase()}/${pin.toString()}/${pronouns.toString().toLowerCase().replace("/", ".")}`, { method: 'POST', headers: { 'Accept': 'text/plain' diff --git a/style.css b/style.css index 7e17474..aba18d7 100644 --- a/style.css +++ b/style.css @@ -8,12 +8,17 @@ body { margin-top: 10%; } +form { + width: 100% +} + #box { background-color: white; padding: 5%; box-shadow: 10px 10px 10px black; - border-radius: 10px; + border-radius: 5px; display:inline-flex; + width: 20%; } #taken { @@ -29,6 +34,7 @@ label { } input { + padding: 3%; background-color: #55CDFC; border-style: none; border-bottom-style: solid;