update java uuid query
All checks were successful
deploy / build-and-deploy (/testvaro, /opt/website-test, website-test) (push) Successful in 14s
deploy / build-and-deploy (/varo, /opt/website, website) (push) Successful in 23s

This commit is contained in:
2025-06-12 23:17:19 +02:00
parent e04d1bf7bf
commit b10f400e4a

View File

@ -1,10 +1,10 @@
export async function getJavaUuid(username: string) {
const response = await fetch(`https://api.mojang.com/users/profiles/minecraft/${username}`);
if (!response.ok) {
// rate limit
if (response.status == 429) return null;
// user doesn't exist
else if (response.status < 500) throw new Error();
if (response.status == 404) throw new Error();
// rate limit
else if (response.status == 429) return null;
return null;
}
const json = await response.json();