From ad33886bbbd6c37d1afed2178dd1659b0c9ad752 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 9 Oct 2024 16:53:46 +0100 Subject: [PATCH] always use `this.meta` in SignupApiService --- packages/backend/src/server/api/SignupApiService.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index c11cd4c448..f21e1bd683 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -126,7 +126,7 @@ export class SignupApiService { } } - if (instance.approvalRequiredForSignup) { + if (this.meta.approvalRequiredForSignup) { if (reason == null || typeof reason !== 'string') { reply.code(400); return; @@ -219,7 +219,7 @@ export class SignupApiService { reply.code(204); return; - } else if (instance.approvalRequiredForSignup) { + } else if (this.meta.approvalRequiredForSignup) { const { account } = await this.signupService.signup({ username, password, host, reason, }); @@ -287,8 +287,6 @@ export class SignupApiService { const code = body['code']; - const instance = await this.metaService.fetch(true); - try { const pendingUser = await this.userPendingsRepository.findOneByOrFail({ code }); @@ -323,7 +321,7 @@ export class SignupApiService { }); } - if (instance.approvalRequiredForSignup) { + if (this.meta.approvalRequiredForSignup) { if (pendingUser.email) { this.emailService.sendEmail(pendingUser.email, 'Approval pending', 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.',