From e38006bbc4e6ea728b2994aedeaa83fe91fe0afc Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Sat, 25 Mar 2023 19:40:50 +0200 Subject: [PATCH] fixing auth issues --- commands/Info/chat.js | 2 +- commands/Info/new-chat.js | 4 ++-- commands/Info/view-session-history.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/Info/chat.js b/commands/Info/chat.js index 0a21905..537df99 100644 --- a/commands/Info/chat.js +++ b/commands/Info/chat.js @@ -39,7 +39,7 @@ module.exports = { let prompt = interaction.options._hoistedOptions[0].value.replace(" ", "+"); const headers = { - 'authority': 'rai.snxraven.me', + 'authority': process.env.PUBLIC_URL, 'accept': 'text/event-stream', }; console.log(session); diff --git a/commands/Info/new-chat.js b/commands/Info/new-chat.js index 70996b4..52ca5db 100644 --- a/commands/Info/new-chat.js +++ b/commands/Info/new-chat.js @@ -14,8 +14,8 @@ module.exports = { .post(`https://${process.env.PUBLIC_URL}/api/chat`) .headers({ 'Accept': 'application/json', 'Content-Type': 'application/json' }) .auth({ - user: 'rai', - pass: 'ilikeai', + user: process.env.USER, + pass: process.env.PASS, sendImmediately: true }) .then((response) => { diff --git a/commands/Info/view-session-history.js b/commands/Info/view-session-history.js index bb39da1..ff85441 100644 --- a/commands/Info/view-session-history.js +++ b/commands/Info/view-session-history.js @@ -28,14 +28,14 @@ module.exports = { return; } const headers = { - 'authority': 'rai.snxraven.me', + 'authority': process.env.PUBLIC_URL, 'accept': 'text/event-stream', }; const response = await axios.get(`http://${process.env.INTERNAL_IP}:8008/api/chat/` + session2, { headers, auth: { - username: "rai", - password: "ilikeai" + username: process.env.USER, + password: process.env.PASS } });