pis #2
@ -19,7 +19,7 @@ async function cmdOut(message) {
|
||||
}
|
||||
|
||||
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
|
||||
method: "POST",
|
||||
headers: {
|
||||
@ -29,6 +29,7 @@ async function registerKey(key) { // Posts key to server and listens for respons
|
||||
body: JSON.stringify(key)
|
||||
})
|
||||
if (res.JSON['result'] == "ok"){
|
||||
localStorage.setItem("uuid", res.JSON['uuid'])
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user