load sitekey from graphql

This commit is contained in:
Jonas Leder 2022-03-08 10:05:28 +01:00
parent 7509544b00
commit d1cda0ba2f
No known key found for this signature in database
GPG key ID: 8A53DD45A7D7B44B

View file

@ -8,7 +8,15 @@ class newComment extends HTMLElement {
}
async setupForm() {
let sitekey = await (await fetch("/API/config.php?name=sitekey")).text();
var graphql = JSON.stringify({
query: "query {\r\n sitekey\r\n}"
})
var requestOptions = {
method: 'POST',
body: graphql,
};
let sitekey = (await (await fetch("/API/graphql.php", requestOptions)).json()).data.sitekey;
let script = document.createElement('script');
script.src = "https://hCaptcha.com/1/api.js";