2
0

fix(docker): 🐛 Runtime public environment

This commit is contained in:
Baptiste Arnaud
2022-06-21 10:36:41 +02:00
parent ea765640cf
commit e03fe9f7d9
54 changed files with 349 additions and 164 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 { isNotEmpty } from 'utils'
import { env, isNotEmpty } from 'utils'
const providers: Provider[] = []
@ -23,10 +23,7 @@ if (isNotEmpty(process.env.GITHUB_CLIENT_ID))
})
)
if (
isNotEmpty(process.env.NEXT_PUBLIC_SMTP_FROM) &&
process.env.SMTP_AUTH_DISABLED !== 'true'
)
if (isNotEmpty(env('SMTP_FROM')) && process.env.SMTP_AUTH_DISABLED !== 'true')
providers.push(
EmailProvider({
server: {
@ -38,7 +35,7 @@ if (
},
ignoreTLS: process.env.SMTP_IGNORE_TLS === 'true',
},
from: process.env.NEXT_PUBLIC_SMTP_FROM,
from: env('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 (isEmpty(process.env.NEXT_PUBLIC_E2E_TEST))
if (env('E2E_TEST') !== 'enabled')
await sendEmailNotification({
to: email,
subject: "You've been invited to collaborate 🤝",