Removed validation

This commit is contained in:
2025-08-30 14:38:00 +02:00
parent 9dfc20ca07
commit c9e83d0980
3 changed files with 36 additions and 33 deletions

View File

@@ -1,29 +1,7 @@
"use server"
import { getUuid } from "./api/mojang"
import { getPlayer } from "./api/player"
import { _validatePlayer } from "./server"
export async function validatePlayer(ign: string) {
const uuid = await getUuid(ign)
if (!uuid) {
return {
error: true,
message: "Player not found"
}
}
const player = await getPlayer(uuid)
if (!player) {
return {
error: true,
message: "Player never logged on to Hypixel"
}
}
return {
error: false,
message: "Player found"
}
return await _validatePlayer(ign)
}

27
src/lib/hypixel/server.ts Normal file
View File

@@ -0,0 +1,27 @@
import { getUuid } from "./api/mojang"
import { getPlayer } from "./api/player"
export async function _validatePlayer(ign: string) {
const uuid = await getUuid(ign)
if (!uuid) {
return {
error: true,
message: "Player not found"
}
}
const player = await getPlayer(uuid)
if (!player) {
return {
error: true,
message: "Player never logged on to Hypixel"
}
}
return {
error: false,
message: "Player found"
}
}