Closed Leccho closed 3 years ago
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.56. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
I've fixed it. With this:
MailerModule.forRoot({
transport: {
host: 'smtp.example.ca',
port: 587,
secure: false,
auth: {
user: "noreply@example.com",
pass: "example",
},
tls: {
rejectUnauthorized: false // this did the trick
}
},
defaults: {
from: '<noreply@example.com>',
},
template: {
dir: __dirname + '/templates',
adapter: new HandlebarsAdapter(),
options: {
strict: true,
},
},
})
const transport = pino.transport({ target: 'pino/file', options: { destination: process.env.LOG_DESTINATION, mkdir: true, }, });
const logger = pino(transport); @Module({ imports: [ NestjsFormDataModule.config({ storage: MemoryStoredFile }),
TypeOrmModule.forFeature([
User,
UserToken,
UserLogin,
RefreshToken,
AddRequest,
Roles,
Permissions,
RolesHasPermissions,
UserHasRoles,
UserPayment,
Visitor,
]),
ConfigModule.forRoot({
isGlobal: true,
validationSchema,
}),
MailerModule.forRootAsync({
useFactory: () => {
return {
transport: {
host: process.env.MAIL_HOST,
secure: false,
auth: {
user: process.env.MAIL_USERNAME,
pass: process.env.MAIL_PASSWORD,
},
tls: {
rejectUnauthorized: false // This trick is working properly
},
},
defaults: {
from: process.env.MAIL_FROM,
},
template: {
dir: join(__dirname, 'templates'),
adapter: new HandlebarsAdapter(),
options: {
strict: true,
},
},
};
},
}),
BullModule.registerQueue({
name: 'notifications',
}),
LoggerModule.forRoot({
pinoHttp: {
logger,
},
}),
JwtModule.register({
secret: process.env.JWT_SECRET,
signOptions: { expiresIn: '3600s' },
}),
], controllers: [AuthController], providers: [ AuthService, LocalStrategy, JwtStrategy, EmailconfirmationService, MailService, UserService, AuthenticationService, S3Service, ], }) export class AuthModule {}
I've been using the same config for a while and it just decided to stop working and throw this error:
I've look for a fix but found nothing conclusive.