-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from fga-eps-mds/14-recover-password
[feat/14] - recover password.
- Loading branch information
Showing
10 changed files
with
308 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Issue: closes: #X | ||
# Issue: closes: # | ||
|
||
## descrição | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ yarn-error.log | |
|
||
# Arquivos de configuração de IDEs | ||
.idea | ||
.vscode | ||
.vscode | ||
.env |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
Copie esse conteúdo para um .env | ||
|
||
NODE_ENV=development | ||
MONGO_URI=mongodb://root:password@mongodb:27017/ | ||
MONGO_INITDB_ROOT_USERNAME=root | ||
MONGO_INITDB_ROOT_PASSWORD=password | ||
DB_HOST=mongodb | ||
PORT=3001 | ||
# host= | ||
# email= | ||
# pass = | ||
EMAIL= [email protected] | ||
EMAIL_USER = (usuário ou email do email) | ||
PASSWORD = (senha do email) | ||
SECRET = S3T1N3L3L4 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const nodemailer = require('nodemailer'); | ||
|
||
const { | ||
EMAIL_USER, | ||
EMAIL, | ||
PASSWORD | ||
} = process.env; | ||
|
||
// Configuração do transporte de email | ||
const transporter = nodemailer.createTransport({ | ||
host: 'sandbox.smtp.mailtrap.io', | ||
port: 2525, | ||
auth: { | ||
user: EMAIL_USER, | ||
pass: PASSWORD | ||
}, | ||
debug: true, // Ativa o modo de depuração | ||
logger: true // Ativa o modo de registro | ||
}); | ||
|
||
const sendEmail = async (destiny, subject, bodyEmail) => { | ||
|
||
try { | ||
const info = await transporter.sendMail({ | ||
from: EMAIL, | ||
to: destiny, | ||
subject: subject, | ||
html: bodyEmail | ||
}); | ||
return 1 | ||
} catch (error) { | ||
console.error('Erro ao enviar email:', error); | ||
return 0; | ||
} | ||
|
||
}; | ||
|
||
module.exports = { | ||
sendEmail | ||
} |
Oops, something went wrong.