Skip to content

Commit

Permalink
fix: to run without AUTH
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasghodsian committed Aug 31, 2024
1 parent 0137b76 commit e654ce4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src-backend/controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ export const getToken = (req, res) => {

export const verifyToken = (req, res, next) => {

const authHeader = req.headers.authorization;
const jwtSecret = process.env.JWTSECRET;
const usr = process.env.AUTH_USER;
const pass = process.env.AUTH_PASS;
const jwtSecret = process.env.JWTSECRET;
const authHeader = req.headers.authorization;

if (!usr || !pass || !jwtSecret) {
return next();
}

if (req.originalUrl.includes("/api/info") || req.originalUrl.includes("/api/auth")){
next();
Expand Down

0 comments on commit e654ce4

Please sign in to comment.