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