Skip to content

Commit

Permalink
feat: adicionar nova funcionalidade para usuário poder fazer o crud d…
Browse files Browse the repository at this point in the history
…o proprios usuários
  • Loading branch information
Fábio Henrique authored and Fábio Henrique committed Nov 24, 2024
1 parent ca05459 commit a13a7be
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/controllers/hook.payment.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const processNotification = async (notification: any) => {
}

const updatePaymentStatus = async (paymentDetails: any) => {

try {
const {
id: paymentId,
Expand Down
10 changes: 10 additions & 0 deletions src/controllers/passwordResetController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ const transporter = nodemailer.createTransport({

// Função para enviar o e-mail com o token de redefinição de senha
export const forgotPassword = async (req: Request, res: Response) => {
// SMTP_HOST=smtp.gmail.com
// # SMTP_PORT=uqvgwqkijeoclvtn
// [email protected]
// SMTP_PASS=kjvfnaxtvzpvfynr

// SMTP_USER=587
console.log(process.env.SMTP_HOST)
console.log(process.env.SMTP_PORT)
console.log(process.env.SMTP_USER)
console.log(process.env.SMTP_PASS)
const { email } = req.body

try {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/createUserRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const createUserRouter = express.Router();

// Rota protegida para criar usuários dentro da empresa do administrador
createUserRouter.post(
'/create-user',
'/users',
authenticate,
authorize(['ADMIN']), // Apenas ADMIN pode criar usuários
createUserInCompany
Expand Down
4 changes: 4 additions & 0 deletions src/services/emailService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import nodemailer from 'nodemailer'

export const sendEmail = async (to: string, subject: string, text: string) => {
console.log(process.env.SMTP_USER)
console.log(process.env.SMTP_PORT)
console.log(process.env.SMTP_USER)
console.log(process.env.SMTP_PASS)
const transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: Number(process.env.SMTP_PORT),
Expand Down

0 comments on commit a13a7be

Please sign in to comment.