diff --git a/README.md b/README.md index 136e795..847688c 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,9 @@ DB_DIALECT= DB_USER= DB_PASS= DB_NAME= + +JWT_SECRET=3123123213123 +JWT_REFRESH_SECRET=75756756756 ``` Install backend dependencies, build app, run migrations and seeds: @@ -205,6 +208,9 @@ DB_DIALECT= DB_USER= DB_PASS= DB_NAME= + +JWT_SECRET=3123123213123 +JWT_REFRESH_SECRET=75756756756 ``` Install puppeteer dependencies: diff --git a/backend/.env.example b/backend/.env.example index 56f7fe6..cea1955 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -9,3 +9,6 @@ DB_HOST= DB_USER= DB_PASS= DB_NAME= + +JWT_SECRET=3123123213123 +JWT_REFRESH_SECRET=75756756756 diff --git a/backend/src/config/auth.ts b/backend/src/config/auth.ts index 978ea08..6f8c5fd 100644 --- a/backend/src/config/auth.ts +++ b/backend/src/config/auth.ts @@ -1,6 +1,6 @@ export default { - secret: "mysecret", + secret: process.env.JWT_SECRET || "mysecret", expiresIn: "15m", - refreshSecret: "myanothersecret", + refreshSecret: process.env.JWT_REFRESH_SECRET || "myanothersecret", refreshExpiresIn: "7d" };