-
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.
started adding adding email verification, lots to do still
- Loading branch information
OomsOoms
committed
May 24, 2024
1 parent
c8718b9
commit e622179
Showing
14 changed files
with
137 additions
and
11 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,3 +1,7 @@ | ||
DATABASE_URI=mongodb://localhost:27017/DatabaseName | ||
SECRET_KEY=SOME_SECRET_KEY | ||
PORT=8000 | ||
SALT_ROUNDS=10 | ||
DOMAIN=http://localhost:8000 | ||
GMAIL_APP_KEY=xxx xxx xxx xxx | ||
GMAIL_EMAIL=[email protected] |
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
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,29 @@ | ||
const nodemailer = require('nodemailer'); | ||
|
||
module.exports = function (to, subject, text) { | ||
const transporter = nodemailer.createTransport({ | ||
service: 'Gmail', | ||
host: 'smtp.gmail.com', | ||
port: 465, | ||
secure: true, | ||
auth: { | ||
user: process.env.EMAIL_USER, | ||
pass: process.env.EMAIL_PASS, | ||
}, | ||
}); | ||
console.log(process.env.EMAIL_USER, process.env.EMAIL_PASS); | ||
const mailOptions = { | ||
//from: "", // If not set, it will be sent from the default email of the gmail account | ||
to: to, | ||
subject: subject, | ||
text: text, | ||
}; | ||
|
||
transporter.sendMail(mailOptions, (error, info) => { | ||
if (error) { | ||
console.error('Error sending email: ', error); | ||
} else { | ||
console.log('Email sent: ', info.response); | ||
} | ||
}); | ||
}; |
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
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 |
---|---|---|
|
@@ -68,6 +68,19 @@ schemas: | |
type: string | ||
location: | ||
type: string | ||
|
||
verificationEmailSent: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
|
||
verified: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
|
||
conflict: | ||
type: object | ||
properties: | ||
|
@@ -125,3 +138,10 @@ requestBodies: | |
newUsername: john_doe | ||
newEmail: [email protected] | ||
newPassword: password | ||
ResendVerification: | ||
type: object | ||
properties: | ||
email: | ||
type: string | ||
example: | ||
email: [email protected] |
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