fix(core): Do not return inviteAcceptUrl in response if email was sent (#7465)
This commit is contained in:
committed by
GitHub
parent
ab6a9bbac2
commit
55c6a1b0d3
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user