aboutsummaryrefslogtreecommitdiff
path: root/src/mojang.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/mojang.ts')
-rw-r--r--src/mojang.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mojang.ts b/src/mojang.ts
index 17918b1..473f9c3 100644
--- a/src/mojang.ts
+++ b/src/mojang.ts
@@ -68,11 +68,12 @@ export async function profileFromUsername(username: string): Promise<MojangApiRe
}
let data
+ const rawData = await fetchResponse.text()
try {
- data = await fetchResponse.json()
+ data = JSON.parse(rawData)
} catch {}
- console.log('mojang returned', data)
+ console.log('mojang returned', rawData)
if (!data?.id) {
console.log('mojang api failed, trying ashcon as backup')