This commit is contained in:
Zai Shi 2025-07-24 14:08:13 -07:00
parent 1f0253258a
commit 588019d4c6
2 changed files with 6 additions and 6 deletions

View File

@ -1042,7 +1042,7 @@ export const currentUserCrudHandlers = createLazyProxy(() => createCrudHandlers(
});
},
async onDelete({ auth }) {
if (auth.type === 'client' && !auth.tenancy.config.client_user_deletion_enabled) {
if (auth.type === 'client' && !auth.tenancy.config.users.allowClientUserDeletion) {
throw new StatusError(StatusError.BadRequest, "Client user deletion is not enabled for this project");
}

View File

@ -353,12 +353,12 @@ export async function sendEmailFromTemplate(options: {
}
export async function getEmailConfig(tenancy: Tenancy): Promise<EmailConfig> {
const projectEmailConfig = tenancy.config.email_config;
const projectEmailConfig = tenancy.config.emails.server;
if (projectEmailConfig.type === 'shared') {
if (projectEmailConfig.isShared) {
return await getSharedEmailConfig(tenancy.project.display_name);
} else {
if (!projectEmailConfig.host || !projectEmailConfig.port || !projectEmailConfig.username || !projectEmailConfig.password || !projectEmailConfig.sender_email || !projectEmailConfig.sender_name) {
if (!projectEmailConfig.host || !projectEmailConfig.port || !projectEmailConfig.username || !projectEmailConfig.password || !projectEmailConfig.senderEmail || !projectEmailConfig.senderName) {
throw new StackAssertionError("Email config is not complete despite not being shared. This should never happen?", { projectId: tenancy.id, emailConfig: projectEmailConfig });
}
return {
@ -366,8 +366,8 @@ export async function getEmailConfig(tenancy: Tenancy): Promise<EmailConfig> {
port: projectEmailConfig.port,
username: projectEmailConfig.username,
password: projectEmailConfig.password,
senderEmail: projectEmailConfig.sender_email,
senderName: projectEmailConfig.sender_name,
senderEmail: projectEmailConfig.senderEmail,
senderName: projectEmailConfig.senderName,
secure: isSecureEmailPort(projectEmailConfig.port),
type: 'standard',
};