-
Notifications
You must be signed in to change notification settings - Fork 0
/
.env
31 lines (19 loc) · 1.27 KB
/
.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//I use monogodb as a database for this setup
PORT=5055
MONGO_URI=monogodb uri
JWT_SECRET=alamsfdfsdfsdfsdrafdar!#$0fddlfjdfdfdssfdsgfgfdgsdf
JWT_SECRET_FOR_VERIFY=lfjfjasjfr09ri09wrilfdjdjertrt
SERVICE=gmail
EMAIL_USER=your email that use for sending email to others
EMAIL_PASS=your email app password, it will be 16digits
HOST=smtp.gmail.com
EMAIL_PORT=465
//when in production mode use this
SITE_URL=http://localhost:3000 //this url url for verification email when front-end run on localhost, change this when use on production server
for setup configuration gmail, you need couple of thing to do:
1. You need an email and password for using email verification and forget the password option.
Use an email that you want to send messages to others when they register or request to forget the password.
I use Nodemailer and the default email server for this.
watch this video https://www.youtube.com/watch?v=J4CtP1MBtOE&list=LL&index=3&ab_channel=TonyTeachesTech to create an app password for email app-password.
After that put your email in .env file EMAIL_USER and app password in the EMAIL_PASS variable.
Also, need to Allow less secure apps to be ON, and access captcha see this doc- https://stackoverflow.com/questions/51980436/nodemailer-throws-error-invalid-login-534-5-7-14