diff --git a/apps/web/app/api/auth/register/route.ts b/apps/web/app/api/auth/register/route.ts index 658fefb2b..bad732db7 100644 --- a/apps/web/app/api/auth/register/route.ts +++ b/apps/web/app/api/auth/register/route.ts @@ -13,7 +13,7 @@ import { } from '@app/services/server/requests'; import { setAuthCookies } from '@app/helpers/cookies'; import { recaptchaVerification } from '@app/services/server/recaptcha'; -import { RECAPTCHA_SECRET_KEY, VERIFY_EMAIL_CALLBACK_PATH } from '@app/constants'; +import { RECAPTCHA_SECRET_KEY, SMTP_PASSWORD, SMTP_USERNAME, VERIFY_EMAIL_CALLBACK_PATH } from '@app/constants'; import { NextResponse } from 'next/server'; export async function POST(req: Request) { @@ -84,10 +84,12 @@ export async function POST(req: Request) { const { data: tenant } = await createTenantRequest(body.team, auth_token); // Create tenant SMTP - await createTenantSmtpRequest({ - access_token: auth_token, - tenantId: tenant.id - }); + if (SMTP_USERNAME && SMTP_PASSWORD) { + await createTenantSmtpRequest({ + access_token: auth_token, + tenantId: tenant.id + }); + } // Create user organization const { data: organization } = await createOrganizationRequest(