Skip to content

Commit

Permalink
Merge pull request #7 from prateek-srivastava001/master
Browse files Browse the repository at this point in the history
added .env file
  • Loading branch information
Mr-Emerald-Wolf authored Aug 25, 2023
2 parents e21f2f2 + 7472a37 commit 6c59993
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ACCESS_KEY_SECRET= S59qsvRec4MPNw3A8LUNiVbZf94rrzpn
REFRESH_KEY_SECRET= Ndlhw8v6Kd0gzbVLznSeSS00mOiNyNLIF
4 changes: 2 additions & 2 deletions api/controllers/jwtController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const jwt = require('jsonwebtoken');
const accessTokenSecret = 'abcd';
const refreshTokenSecret = 'defg';
const accessTokenSecret = process.env.ACCESS_KEY_SECRET;
const refreshTokenSecret = process.env.REFRESH_KEY_SECRET;

const jwtController = {
signAccessToken: (regNo) => {
Expand Down
2 changes: 1 addition & 1 deletion api/middleware/jwtMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const jwt = require('jsonwebtoken');
const key = 'abcd';
const key = process.env.ACCESS_KEY_SECRET;

function verifyToken(req, res, next) {
const authHeader = req.header('Authorization');
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ app.get("/ping", (_, res) => {


app.use("/api/testcases/", TestCaseRouter)
app.use(authRoute);
app.use('/auth/',authRoute);


// Starting Server
Expand Down

0 comments on commit 6c59993

Please sign in to comment.