Skip to content

Commit a344563

Browse files
committed
fixed BYPASS_LOGIN env variable always bypassing regardless of the value
1 parent f4004f8 commit a344563

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/utils/v2/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ const authMiddleware = async (req, res, next) => {
132132
let authed = false
133133

134134
if (process.env.BYPASS_LOGIN) {
135-
authed = process.env.BYPASS_LOGIN
135+
// values in .env file are interpreted as strings, so you have to check
136+
authed = process.env.BYPASS_LOGIN === 'true'
136137
} else {
137138
authed = await validateToken(req)
138139
if (authed) {

0 commit comments

Comments
 (0)