From 8673f589cb2c3acc2708b4037e4ca5e16a0db00f Mon Sep 17 00:00:00 2001 From: ravirajput10 Date: Thu, 10 Oct 2024 07:54:49 +0000 Subject: [PATCH] Fixed sending auth code --- apps/web/graphql/mails/helpers.ts | 2 +- apps/web/graphql/users/logic.ts | 2 +- apps/web/pages/api/auth/code/generate.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/graphql/mails/helpers.ts b/apps/web/graphql/mails/helpers.ts index 4d1386302..2c5940626 100644 --- a/apps/web/graphql/mails/helpers.ts +++ b/apps/web/graphql/mails/helpers.ts @@ -88,7 +88,7 @@ export async function createTemplateAndSendMail({ loginLink: `${ctx.address}/login`, courseName: course.title, name: course.creatorName || ctx.subdomain.settings.title || "", - hideCourseLitBranding: ctx.subdomain.settings.hideCourseLitBranding, + hideCourseLitBranding: ctx.subdomain.settings?.hideCourseLitBranding, }); await send({ diff --git a/apps/web/graphql/users/logic.ts b/apps/web/graphql/users/logic.ts index c3f024525..90d54d4fc 100644 --- a/apps/web/graphql/users/logic.ts +++ b/apps/web/graphql/users/logic.ts @@ -200,7 +200,7 @@ export const inviteCustomer = async ( courseName: course.title, loginLink: `${ctx.address}/login`, hideCourseLitBranding: - ctx.subdomain.settings.hideCourseLitBranding, + ctx.subdomain.settings?.hideCourseLitBranding, }); await send({ diff --git a/apps/web/pages/api/auth/code/generate.ts b/apps/web/pages/api/auth/code/generate.ts index 8235058c9..cd0fb8d26 100644 --- a/apps/web/pages/api/auth/code/generate.ts +++ b/apps/web/pages/api/auth/code/generate.ts @@ -40,7 +40,7 @@ export default async function handler( try { const emailBody = pug.render(MagicCodeEmailTemplate, { code, - hideCourseLitBranding: domain.settings.hideCourseLitBranding, + hideCourseLitBranding: domain.settings?.hideCourseLitBranding, }); await send({ to: [sanitizedEmail],