fix(core): Do not return inviteAcceptUrl in response if email was sent (#7465)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-19 13:58:06 +02:00
committed by GitHub
parent ab6a9bbac2
commit 55c6a1b0d3
11 changed files with 74 additions and 102 deletions

View File

@@ -12,13 +12,6 @@ import { License } from '@/License';
import { getWebhookBaseUrl } from '@/WebhookHelpers';
import { RoleService } from '@/services/role.service';
export function isEmailSetUp(): boolean {
const smtp = config.getEnv('userManagement.emails.mode') === 'smtp';
const host = !!config.getEnv('userManagement.emails.smtp.host');
return smtp && host;
}
export function isSharingEnabled(): boolean {
return Container.get(License).isSharingEnabled();
}

View File

@@ -34,14 +34,17 @@ async function getTemplate(
@Service()
export class UserManagementMailer {
readonly isEmailSetUp: boolean;
private mailer: NodeMailer | undefined;
constructor() {
// Other implementations can be used in the future.
if (
this.isEmailSetUp =
config.getEnv('userManagement.emails.mode') === 'smtp' &&
config.getEnv('userManagement.emails.smtp.host') !== ''
) {
config.getEnv('userManagement.emails.smtp.host') !== '';
// Other implementations can be used in the future.
if (this.isEmailSetUp) {
this.mailer = new NodeMailer();
}
}