Most of the key features work at this point.

This commit is contained in:
Scott Idem
2020-03-06 15:34:15 -05:00
parent 37b708047f
commit 2ddcde1642
7 changed files with 213 additions and 134 deletions

View File

@@ -5,28 +5,29 @@ async function api_token_request_async(axios, secret_key) {
console.log('Already waiting on an API token request. Not starting another until finished.');
return false;
} else {
waiting_on_api_token = true;
const url = '/api_token_request';
let data = { secret_key: secret_key };
const result = await axios.post(url, data)
.then(function (response) {
//console.log(response);
const api_temporary_token = response.data.temporary_token;
//console.log('API Temporary Token: '+temporary_token);
return api_temporary_token;
})
.catch(function (error) {
console.error(error);
return false;
});
waiting_on_api_token = false;
return result;
}
waiting_on_api_token = true;
const url = '/api_token_request';
let data = { secret_key: secret_key };
const result = await axios.post(url, data)
.then(function (response) {
//console.log(response);
const api_temporary_token = response.data.temporary_token;
//console.log('API Temporary Token: '+temporary_token);
return api_temporary_token;
})
.catch(function (error) {
console.error(error);
return false;
});
waiting_on_api_token = false;
return result;
return false;
}