From a9636a70389246a85c2df15cd0e1e441641c785a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 10 Dec 2012 16:56:19 -0800 Subject: Don't rely on short-circuit logical operators --- app.coffee | 9 ++++----- views/main/about.html | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app.coffee b/app.coffee index ea2986c7..5ac4b033 100644 --- a/app.coffee +++ b/app.coffee @@ -9,7 +9,7 @@ transactions = require("./routes/transactions") users = require("./routes/users") RedisStore = require('connect-redis')(express) -sessionStore = new RedisStore() +sessionStore = new RedisStore(ttl: 172800) app = express() app.enable('trust proxy') @@ -46,10 +46,9 @@ for route, view of routes )(route, view) authorize = (req, res, next) -> - console.log(req.user) - return next() if req.isAuthenticated() and - (req.params.user and req.params.user is req.user.username) or - req.user.username is 'admin' + if req.params.user? is req.user?.username or + req.user?.username is 'admin' + return next() res.redirect('/login') app.get('/setup', calculator.new) diff --git a/views/main/about.html b/views/main/about.html index fc8fcd23..42155a33 100644 --- a/views/main/about.html +++ b/views/main/about.html @@ -11,10 +11,9 @@

- Transactions between bitcoin addresses are + New addresses start with a zero balance. Transactions between addresses are recorded in a public file and published on - the Internet. The file keeps track of the balance of every - address. New addresses start with a zero balance. + the Internet. Copies of the file are distributed over the bitcoin network which keeps track of the balance at every address.

-- cgit v1.2.3