Fix URL for register in auth.js

This commit is contained in:
Fred Boniface 2023-04-05 21:25:28 +01:00
parent 8e079512cc
commit 29d293c77f
1 changed files with 2 additions and 1 deletions

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;