2
0

Revert "fix(docker): 🐛 Runtime public environment"

This reverts commit e03fe9f7d9.
This commit is contained in:
Baptiste Arnaud
2022-06-22 07:21:02 +02:00
parent e03fe9f7d9
commit 3e47b37c2e
54 changed files with 164 additions and 349 deletions

View File

@@ -11,7 +11,7 @@ import { NextApiRequest, NextApiResponse } from 'next'
import { withSentry } from '@sentry/nextjs'
import { CustomAdapter } from './adapter'
import { User } from 'db'
import { env, isNotEmpty } from 'utils'
import { isNotEmpty } from 'utils'
const providers: Provider[] = []
@@ -23,7 +23,10 @@ if (isNotEmpty(process.env.GITHUB_CLIENT_ID))
})
)
if (isNotEmpty(env('SMTP_FROM')) && process.env.SMTP_AUTH_DISABLED !== 'true')
if (
isNotEmpty(process.env.NEXT_PUBLIC_SMTP_FROM) &&
process.env.SMTP_AUTH_DISABLED !== 'true'
)
providers.push(
EmailProvider({
server: {
@@ -35,7 +38,7 @@ if (isNotEmpty(env('SMTP_FROM')) && process.env.SMTP_AUTH_DISABLED !== 'true')
},
ignoreTLS: process.env.SMTP_IGNORE_TLS === 'true',
},
from: env('SMTP_FROM'),
from: process.env.NEXT_PUBLIC_SMTP_FROM,
})
)

View File

@@ -8,8 +8,8 @@ import { sendEmailNotification } from 'services/api/emails'
import { getAuthenticatedUser } from 'services/api/utils'
import {
badRequest,
env,
forbidden,
isEmpty,
methodNotAllowed,
notAuthenticated,
} from 'utils'
@@ -66,7 +66,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
await prisma.invitation.create({
data: { email: email.toLowerCase(), type, typebotId },
})
if (env('E2E_TEST') !== 'enabled')
if (isEmpty(process.env.NEXT_PUBLIC_E2E_TEST))
await sendEmailNotification({
to: email,
subject: "You've been invited to collaborate 🤝",