pis #2

Merged
fred.boniface merged 76 commits from pis into main 2023-05-06 21:53:45 +01:00
Showing only changes of commit 29d293c77f - Show all commits

View File

@ -19,7 +19,7 @@ async function cmdOut(message) {
} }
async function registerKey(key) { // Posts key to server and listens for response. async function registerKey(key) { // Posts key to server and listens for response.
var url = `${window.location.origin}/api/v1/auth/register`; var url = `${window.location.origin}/api/v1/register/register`;
let res = await fetch(url, { // The response will contain the UUID which will be registered let res = await fetch(url, { // The response will contain the UUID which will be registered
method: "POST", method: "POST",
headers: { headers: {
@ -29,6 +29,7 @@ async function registerKey(key) { // Posts key to server and listens for respons
body: JSON.stringify(key) body: JSON.stringify(key)
}) })
if (res.JSON['result'] == "ok"){ if (res.JSON['result'] == "ok"){
localStorage.setItem("uuid", res.JSON['uuid'])
return true; return true;
} else { } else {
return false; return false;