always use this.meta in SignupApiService

This commit is contained in:
dakkar 2024-10-09 16:53:46 +01:00
parent afbed7f605
commit ad33886bbb

View file

@ -126,7 +126,7 @@ export class SignupApiService {
} }
} }
if (instance.approvalRequiredForSignup) { if (this.meta.approvalRequiredForSignup) {
if (reason == null || typeof reason !== 'string') { if (reason == null || typeof reason !== 'string') {
reply.code(400); reply.code(400);
return; return;
@ -219,7 +219,7 @@ export class SignupApiService {
reply.code(204); reply.code(204);
return; return;
} else if (instance.approvalRequiredForSignup) { } else if (this.meta.approvalRequiredForSignup) {
const { account } = await this.signupService.signup({ const { account } = await this.signupService.signup({
username, password, host, reason, username, password, host, reason,
}); });
@ -287,8 +287,6 @@ export class SignupApiService {
const code = body['code']; const code = body['code'];
const instance = await this.metaService.fetch(true);
try { try {
const pendingUser = await this.userPendingsRepository.findOneByOrFail({ code }); const pendingUser = await this.userPendingsRepository.findOneByOrFail({ code });
@ -323,7 +321,7 @@ export class SignupApiService {
}); });
} }
if (instance.approvalRequiredForSignup) { if (this.meta.approvalRequiredForSignup) {
if (pendingUser.email) { if (pendingUser.email) {
this.emailService.sendEmail(pendingUser.email, 'Approval pending', this.emailService.sendEmail(pendingUser.email, 'Approval pending',
'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.', 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.',