Implemented email verification

This commit is contained in:
2024-04-12 13:52:16 +03:00
parent 78107d4ec7
commit b1ad7b5c3e
51 changed files with 604 additions and 213 deletions

View File

@@ -1,16 +1,16 @@
import { env } from 'process'
import SMTPTransport from 'nodemailer/lib/smtp-transport'
import { env } from '@/lib/utils'
export const from: string = `"${env.MAIL_SERVER_SENDER_NAME}" <${env.MAIL_SERVER_USERNAME}>`
export const from: string = `"${env('MAIL_SERVER_SENDER_NAME')}" <${env('MAIL_SERVER_USERNAME')}>`
export const transportOptions: SMTPTransport | SMTPTransport.Options | string = {
host: env.MAIL_SERVER_HOST,
debug: env.MAIL_SERVER_DEBUG === 'true',
logger: env.MAIL_SERVER_LOG === 'true',
port: parseInt(env.MAIL_SERVER_PORT as string),
secure: env.MAIL_SERVER_PORT === '465', // Use `true` for port 465, `false` for all other ports
host: env('MAIL_SERVER_HOST'),
debug: env('MAIL_SERVER_DEBUG') === 'true' && env('NODE_ENV') !== 'production',
logger: env('MAIL_SERVER_LOG') === 'true' && env('NODE_ENV') !== 'production',
port: parseInt(env('MAIL_SERVER_PORT')),
secure: env('MAIL_SERVER_PORT') === '465', // Use `true` for port 465, `false` for all other ports
auth: {
user: env.MAIL_SERVER_USERNAME, pass: env.MAIL_SERVER_PASSWORD,
user: env('MAIL_SERVER_USERNAME'), pass: env('MAIL_SERVER_PASSWORD'),
},
}