GJordao / simple-auth

An authentication service that aims to be simple and customisable
MIT License
3 stars 3 forks source link

Expose nodemailer configurations #39

Closed nneves closed 2 years ago

nneves commented 2 years ago

Closes: https://github.com/GJordao/simple-auth/issues/37 Closes: https://github.com/GJordao/simple-auth/issues/38

When trying to register a new user /auth/register started to notice that the user would return with the "accountActive" set to true, and "Email service is offiline" message. While trying to debug and switch between SMTP configurations I have noticed that some TLS options are not exposed. https://github.com/GJordao/simple-auth/issues/38

Also, added a new ENV VAR STMP_DEBUG to allow debuging smtp related issues.

BTW: The reported issue was related with the bug reported on https://github.com/GJordao/simple-auth/issues/37 , I was setting SMTP_secure=false but it was always enabling that option.

PR changes requires for the local .env file to use a new setup to work with the smtp.ethereal.email service:

SMTP_SECURE=false
SMTP_REQUIRE_TLS=true
SMTP_IGNORE_TLS=false

Question: should I set this to be the default behaviour if no env var is set? (SMTP_REQUIRE_TLS default value set to true ???)