Skip to content

Commit

Permalink
fix #299: db authentication issue when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Jul 28, 2024
1 parent 403b924 commit 2d79302
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/scripts/auth/star.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2d79302

Please sign in to comment.