From 0a513d2350ef4ae2070d9505c985e48437e99a9e Mon Sep 17 00:00:00 2001 From: bytedream Date: Tue, 10 Jun 2025 11:50:52 +0200 Subject: [PATCH] do not allow sign in if team member is blocked --- src/actions/signup.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/actions/signup.ts b/src/actions/signup.ts index 8025c35..b61bfe2 100644 --- a/src/actions/signup.ts +++ b/src/actions/signup.ts @@ -66,8 +66,9 @@ export const signup = { }); } + let memberUuid; try { - await getJavaUuid(input.teamMember); + memberUuid = await getJavaUuid(input.teamMember); } catch (_) { throw new ActionError({ code: 'NOT_FOUND', @@ -85,6 +86,15 @@ export const signup = { }); } } + if (memberUuid) { + const blockedUser = await db.getBlockedUserByUuid({ uuid: memberUuid }); + if (blockedUser) { + throw new ActionError({ + code: 'FORBIDDEN', + message: 'Dein Mitspieler ist für die Registrierung gesperrt. Bitte suche dir einen anderen Mitspieler' + }); + } + } if (!teamDraft) { // check if a team with the same name already exists