pis #2
@ -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;
|
||||||
|
Reference in New Issue
Block a user