Permalink
Browse files

add a config option to override the auth and pretend to be always log…

…ged in (like master is)
  • Loading branch information...
1 parent 0f94601 commit 074dc1d671b2e729ca505fbc33db5ba1e8b8dec7 @quartzjer quartzjer committed Mar 19, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 Common/node/lconfig.js
  2. +1 −1 Ops/webservice.js
View
@@ -100,6 +100,7 @@ exports.load = function(filepath) {
exports.mail = config.mail;
exports.homeApp = config.homeApp;
exports.authSecret = config.authSecret;
+ exports.authedAlways = config.authedAlways || false;
try {
if(path.existsSync(path.join(exports.me,'login.json'))) exports.authLogin = JSON.parse(fs.readFileSync(path.join(exports.me,'login.json')).toString());
}catch(E){
View
@@ -82,7 +82,7 @@ var locker = express.createServer(
// specificly, is this an externally auth'd request
function isAuthed(req)
{
- var authed = false;
+ var authed = lconfig.authedAlways; // configuration can say always-logged-in
if(req.headers.secret && req.headers.secret == lconfig.authSecret) authed = true; // for a config-authorized blanket external request
if(lconfig.authLogin && req.cookies.lockerlogin == lconfig.authLogin.cookie) authed = true; // browser auth'd
req.headers.authed = (authed) ? "true" : "false"; // set special header for any subsequent or proxied request

0 comments on commit 074dc1d

Please sign in to comment.