fix registration working when uuid cannot be fetched and user already exists
All checks were successful
delpoy / build-and-deploy (push) Successful in 59s

This commit is contained in:
bytedream 2024-12-02 18:17:23 +01:00
parent 4627d3de30
commit a1965c62e2

View File

@ -60,7 +60,10 @@ export const POST = (async ({ request }) => {
}
}
if (uuid && (await User.findOne({ where: { uuid: uuid } }))) {
if (
(uuid && (await User.findOne({ where: { uuid: uuid } }))) ||
(!uuid && (await User.findOne({ where: { username: data.username } })))
) {
throw error(
400,
'Dein Minecraft-Account wurde bereits registriert.\n\nKontaktiere bitte einen Admin, falls diese ' +