From db164b09ac2dd84f7c2a7977b2d8bc6f3a1d5e21 Mon Sep 17 00:00:00 2001 From: Shiny Nematoda Date: Tue, 6 Aug 2024 12:50:20 +0000 Subject: [PATCH] fix: use getJson rather than calling fetch directly for getJsonAuth closes #175 --- src/scripts/fetch.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/scripts/fetch.js b/src/scripts/fetch.js index f8317bb..d456c05 100644 --- a/src/scripts/fetch.js +++ b/src/scripts/fetch.js @@ -55,12 +55,8 @@ export async function getJsonHyp(path) { export async function getJsonAuth(path, opts = {}) { const root = useStore().getItem('authapi') || PIPED_INSTANCE; - - return await fetch('https://' + root + path, opts) - .then(res => res.json()) - .catch(err => { - useAlert().add(err); - }); + + return await getJson('https://' + root + path, opts); } function useAuthToken() {