fix: invite code not being marked as used

Fixes an issue where if approval and invite were enabled the code would stay as unused
This commit is contained in:
Mar0xy 2023-10-19 10:42:18 +02:00 committed by kakkokari-gtyih
parent 576e13879f
commit d222c79ff8
1 changed files with 9 additions and 1 deletions

View File

@ -211,7 +211,7 @@ export class SignupApiService {
reply.code(204);
return;
} else if (instance.approvalRequiredForSignup) {
await this.signupService.signup({
const { account } = await this.signupService.signup({
username, password, host, reason,
});
@ -221,6 +221,14 @@ export class SignupApiService {
'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.');
}
if (ticket) {
await this.registrationTicketsRepository.update(ticket.id, {
usedAt: new Date(),
usedBy: account,
usedById: account.id,
});
}
reply.code(204);
return;
} else {