From 696949ddb90b8c6db295e3ff43dd5c947940c0bb Mon Sep 17 00:00:00 2001 From: Leo dev Date: Mon, 22 Sep 2025 16:42:49 +0200 Subject: [PATCH] Updated auth test --- src/test/auth.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/auth.js b/src/test/auth.js index f7ddf79..d512260 100644 --- a/src/test/auth.js +++ b/src/test/auth.js @@ -1,11 +1,12 @@ import axios from "axios"; -// Create a temp token -axios.post('http://localhost:3000/api/auth', { +const res = (await axios.post('http://localhost:3000/api/auth', { intents: 'server', server_ip: 'localhost' -}).then((r) => { - console.log(r.data); -}).catch((e) => { - console.log(e); -}); \ No newline at end of file +})).data; + +const token = res.token; + +const output = (await axios.get('http://localhost:3000/api/auth?intents=server&token='+token)).data; + +console.log(output); \ No newline at end of file