fix: use getJson rather than calling fetch directly for getJsonAuth

closes #175
This commit is contained in:
Shiny Nematoda 2024-08-06 12:50:20 +00:00
parent 2c20ac430d
commit db164b09ac

View file

@ -55,12 +55,8 @@ export async function getJsonHyp(path) {
export async function getJsonAuth(path, opts = {}) { export async function getJsonAuth(path, opts = {}) {
const root = useStore().getItem('authapi') || PIPED_INSTANCE; const root = useStore().getItem('authapi') || PIPED_INSTANCE;
return await fetch('https://' + root + path, opts) return await getJson('https://' + root + path, opts);
.then(res => res.json())
.catch(err => {
useAlert().add(err);
});
} }
function useAuthToken() { function useAuthToken() {