From 3d3ab5180fda35bd088a00fba982635144fc3b28 Mon Sep 17 00:00:00 2001 From: Isaac Grynsztein Date: Fri, 10 Apr 2020 21:03:37 -0400 Subject: [PATCH] fixed bug that prevented non-api routes from loading without an auth header --- backend/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app.js b/backend/app.js index 2db9ee7..2f0e2e5 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1230,7 +1230,9 @@ app.use(function(req, res, next) { }); app.use(function(req, res, next) { - if (req.headers.authorization === admin_token) { + if (!req.path.includes('/api/')) { + next(); + } else if (req.headers.authorization === admin_token) { next(); } else if (req.headers.authorization && config_api.getConfigItem('ytdl_use_api_key') && req.headers.authorization === config_api.getConfigItem('ytdl_api_key')) { next();