Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ›‚ Checks header auth users against conf.yml on the server

Alicia Sykes8ee1f82b9df3
diff --git a/services/app.js b/services/app.js
index 59e3384b..710316d7 100644
--- a/services/app.js
+++ b/services/app.js
@@ -175,7 +175,10 @@ function getAuthMiddleware(authConfig, oidcSettings) {
if (!user) {
return res.status(401).json({ success: false, message: 'Unauthorized - missing user header' });
}
- req.auth = { user };
+ const users = loadUserConfig() || [];
+ if (users.some(u => u.user?.toLowerCase() === user.toLowerCase())) {
+ req.auth = { user };
+ }
return next();
};
}