From 38d49a1fe877a0f0fce6b2185cdfcd07fd1e4ccd Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Wed, 19 Oct 2022 22:46:49 +0200 Subject: [PATCH] Debug / manual tests tools for auth --- web/admin-gui/src/views/Home.vue | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/web/admin-gui/src/views/Home.vue b/web/admin-gui/src/views/Home.vue index 4faceb2..0862bff 100644 --- a/web/admin-gui/src/views/Home.vue +++ b/web/admin-gui/src/views/Home.vue @@ -4,6 +4,8 @@ import { pingApi } from '@/utils/ping'; import { onMounted, ref } from 'vue'; const inputArticleID = ref('') +const username = ref('') +const password = ref('') onMounted(async function() { console.log('ping...') @@ -40,6 +42,18 @@ function deleteArticle(articleID: String) { .then(response => response.json()) .then(result => console.log(result)) } + +function auth(type: string, username: string, password: string) { + fetch(`http://localhost:8080/${type}`, { + method: "POST", + body: JSON.stringify({ + email: username, + password: password + }) + }) + .then(response => response.json()) + .then(result => console.log(result)) +}