diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-19 10:42:18 +0200 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-19 10:42:18 +0200 |
| commit | c3f768181ae232a9ac03c69759f5508398b4cd55 (patch) | |
| tree | 770632fcd423109b68679920f3201a7835631ffd /packages/backend/src/server | |
| parent | fix: system users not being set to approved on creation (diff) | |
| download | sharkey-c3f768181ae232a9ac03c69759f5508398b4cd55.tar.gz sharkey-c3f768181ae232a9ac03c69759f5508398b4cd55.tar.bz2 sharkey-c3f768181ae232a9ac03c69759f5508398b4cd55.zip | |
fix: invite code not being marked as used
Fixes an issue where if approval and invite were enabled the code would stay as unused
Diffstat (limited to 'packages/backend/src/server')
| -rw-r--r-- | packages/backend/src/server/api/SignupApiService.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index 418656fdbc..c07389d975 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -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 { |