Login Hotfix

The script that handles logggin in and the form for getting that
information were both posting the info which would result in an
intemittent uncaught error.

An attribute was added to the form so it does not submit at the same
time the JS sends a request.

A minor bug but it was annoying.
This commit is contained in:
Ro 2022-11-04 12:52:19 -07:00
parent 61ae73a9e5
commit ec1dc49ba1
No known key found for this signature in database
GPG key ID: 10C182AC6984D373
4 changed files with 2 additions and 7 deletions

View file

@ -225,9 +225,6 @@ class APIControl
]; ];
break; break;
} }
var_dump($result);
$response->getBody()->write(json_encode($result)); $response->getBody()->write(json_encode($result));
return $response->withHeader('Content-Type', 'application/json'); return $response->withHeader('Content-Type', 'application/json');
} }

View file

@ -2,10 +2,10 @@
<div> <div>
<img id="the-logo" src="/assets/images/global/fipamo-logo.svg"/> <img id="the-logo" src="/assets/images/global/fipamo-logo.svg"/>
</div> </div>
<form id="login" class='login' name="login" method="POST"> <form id="login" class='login' name="login" method="POST" onsubmit="return false;">
<input type="text" name="handle" class="form-control" placeholder="Handle" required/> <input type="text" name="handle" class="form-control" placeholder="Handle" required/>
<input type="password" name="password" class="form-control" placeholder="Password" required/> <input type="password" name="password" class="form-control" placeholder="Password" required/>
<button id="login-btn" class='login-btn' type='submit'> <button id="login-btn" class='login-btn'>
ID, PLEASE ID, PLEASE
</button> </button>
<a href="/dashboard/reset-password">?</a> <a href="/dashboard/reset-password">?</a>

View file

@ -557,7 +557,6 @@ class Base {
let self = this; let self = this;
e.preventDefault(); e.preventDefault();
let authForm = data.formDataToJSON(document.getElementById("login")); let authForm = data.formDataToJSON(document.getElementById("login"));
console.log("authform");
notify.alert("Looking, hold up", null); notify.alert("Looking, hold up", null);
let api = new (0, _fipamoAdminAPIDefault.default)(); let api = new (0, _fipamoAdminAPIDefault.default)();
this.processing = true; this.processing = true;

View file

@ -57,7 +57,6 @@ export default class Base {
let self = this; let self = this;
e.preventDefault(); e.preventDefault();
let authForm = data.formDataToJSON(document.getElementById('login')); let authForm = data.formDataToJSON(document.getElementById('login'));
console.log('authform');
notify.alert('Looking, hold up', null); notify.alert('Looking, hold up', null);
let api = new FipamoAdminAPI(); let api = new FipamoAdminAPI();
this.processing = true; this.processing = true;