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:
parent
059401aeab
commit
c3f768181a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user