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
parent 059401aeab
commit c3f768181a
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828

View File

@ -199,7 +199,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,
});
@ -209,6 +209,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 {