From 3417ce8d5f4e64f6b9e8e8156a5a069e2d851be1 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 21 Mar 2024 07:48:06 +0100 Subject: [PATCH] changed unauth https access method --- docs/06-demopage.md | 16 ++++++++-------- docs/_includes/js/custom.js | 14 ++++++++++---- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/06-demopage.md b/docs/06-demopage.md index 0a9f26d..2b4e0a2 100644 --- a/docs/06-demopage.md +++ b/docs/06-demopage.md @@ -14,10 +14,10 @@ Just fill out the following form to install your instance of Red Hat Ansible Aut

Access Token:

-

+

Name:

-

-

+

+

Cloud Provider*:

-

-

+

+

+

SSH Keypair Configuration -

+

-

+

diff --git a/docs/_includes/js/custom.js b/docs/_includes/js/custom.js index 5079168..d9bf196 100644 --- a/docs/_includes/js/custom.js +++ b/docs/_includes/js/custom.js @@ -69,7 +69,7 @@ function nextPrev(n) { if (currentTab >= x.length) { // ... the form gets submitted: //document.getElementById("regForm").submit() - currentTab = 0; + currentTab = 1; submit_AAP(); } // Otherwise, display the correct tab: @@ -95,6 +95,7 @@ function validateForm() { } // add all values to the formdata object formdata[y[i].id] = y[i].value; + console.log(y[i].id + " " + formdata[y[i].id]); } // If the valid status is true, mark the step as finished and valid: if (valid) { @@ -157,10 +158,14 @@ function submit_AAP() { const data = { "extra_vars": { formdata }, }; - - alert("Token " + apiKey); // disable cert check - process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; + const fetch = require('node-fetch'); + const https = require('https'); + const httpsAgent = new https.Agent({ + rejectUnauthorized: false, + }); + // The following only works in CLI + // process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; const requestOptions = { method: 'POST', @@ -169,6 +174,7 @@ function submit_AAP() { 'Content-Type': 'application/json', }, body: JSON.stringify(data), + agent: httpsAgent, }; fetch(apiUrl, requestOptions)