mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2026-05-24 16:49:09 -05:00
Merge pull request #1140 from tomaioo/fix/security/potential-auth-token-leakage-to-third-pa
This commit is contained in:
@@ -10,10 +10,10 @@ export default async function fetchPatrons(api: Api | undefined): Promise<Patron
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!api) return reject(new Error('No API instance provided'))
|
||||
|
||||
api.axiosInstance
|
||||
.get(PATRON_API_ENDPOINT)
|
||||
.then((res) => {
|
||||
const patrons = res.data as Patron[]
|
||||
fetch(PATRON_API_ENDPOINT)
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw new Error(`Request failed with status ${res.status}`)
|
||||
const patrons = (await res.json()) as Patron[]
|
||||
resolve(patrons)
|
||||
})
|
||||
.catch((err) => reject(err))
|
||||
|
||||
Reference in New Issue
Block a user