Skip to content

Commit 37e3cc2

Browse files
committed
fixed workflow action for auth
1 parent f894016 commit 37e3cc2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
env:
1111
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }}
1212
DB_URL: ${{ secrets.DB_URL }}
13+
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
1314

1415
permissions:
1516
contents: read

middleware/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import jwt from "jsonwebtoken";
22
import util from "#util";
33

44
async function authenticateToken(req, res, next) {
5-
if (process.env.STATE === "Development") {
5+
if (process.env.ENVIRONMENT === "local") {
66
return next();
77
}
88
const authHeader = req.headers.authorization || req.headers.Authorization;

middleware/authorization.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function authorization(access = []) {
22
return (req, res, next) => {
33
// remove this in production
4-
if (process.env.STATE === "Development") {
4+
if (process.env.ENVIRONMENT === "local") {
55
return next();
66
}
77
if (!req.user) return res.json({ msg: "kindly login first" });

0 commit comments

Comments
 (0)