From 7457b39774386f33544b6626230af1d30d288c9d Mon Sep 17 00:00:00 2001 From: Ada Werefox Date: Thu, 24 Apr 2025 15:08:25 -0700 Subject: [PATCH] Update to make standardized API endpoints --- src/components/HomePage.vue | 2 +- src/ts/authorization.ts | 3 +-- src/ts/user_info.ts | 4 +--- src/views/UserDashboard.vue | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/HomePage.vue b/src/components/HomePage.vue index 5719d24..f4928c5 100644 --- a/src/components/HomePage.vue +++ b/src/components/HomePage.vue @@ -12,7 +12,7 @@

Login with Discord

diff --git a/src/ts/authorization.ts b/src/ts/authorization.ts index e50562e..14327f8 100644 --- a/src/ts/authorization.ts +++ b/src/ts/authorization.ts @@ -1,11 +1,10 @@ export function isLoggedIn(): Promise { - return fetch('http://localhost:31337/authorized', { + return fetch('http://localhost:31337/get/user/authorized', { credentials: 'include', }) .then((res) => { return res.json().then((res_json) => { const is_authorized = res_json.message - console.log('whwhwhw' + is_authorized) return Boolean(is_authorized) }) }) diff --git a/src/ts/user_info.ts b/src/ts/user_info.ts index 387490b..4678de0 100644 --- a/src/ts/user_info.ts +++ b/src/ts/user_info.ts @@ -9,19 +9,17 @@ export const user_store = reactive({ }) export function update_info() { - fetch('http://localhost:31337/dashboard', { + fetch('http://localhost:31337/get/user/info', { credentials: 'include', }) .then((res) => { res .json() .then((userjson) => { - console.log(userjson) user_store.avatar_decoration = 'https://cdn.discordapp.com/avatar-decoration-presets/' + userjson.avatar_decoration_data.asset + '.png' - console.log(user_store) user_store.avatar = 'https://cdn.discordapp.com/avatars/' + userjson.id + '/' + userjson.avatar + '.png' user_store.id = 'https://discord.com/users/' + userjson.id diff --git a/src/views/UserDashboard.vue b/src/views/UserDashboard.vue index a6fc8dc..20d370c 100644 --- a/src/views/UserDashboard.vue +++ b/src/views/UserDashboard.vue @@ -26,7 +26,7 @@ onMounted(update_info)

Logout