Removed api url
This commit is contained in:
parent
b3adc7c7dd
commit
ddac236778
4 changed files with 13 additions and 10 deletions
5
login.js
5
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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue