From 2d79302af4548f33be1ba99ccba734043a9e4d1e Mon Sep 17 00:00:00 2001 From: Geoffrey Wu Date: Sun, 28 Jul 2024 13:04:36 -0400 Subject: [PATCH] fix #299: db authentication issue when not logged in --- client/scripts/auth/star.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/scripts/auth/star.js b/client/scripts/auth/star.js index 25b1ab00..a0f1c89b 100644 --- a/client/scripts/auth/star.js +++ b/client/scripts/auth/star.js @@ -110,12 +110,20 @@ export default class star { } static async getStarredTossupIds () { + if (!(await account.getUsername())) { + return []; + } + return await fetch('/auth/stars/tossup-ids') .then(response => response.json()) .then(ids => ids); } static async getStarredBonusIds () { + if (!(await account.getUsername())) { + return []; + } + return await fetch('/auth/stars/bonus-ids') .then(response => response.json()) .then(ids => ids);