diff options
| author | Adam Soltys <[email protected]> | 2012-12-10 16:56:19 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-12-10 16:56:19 -0800 |
| commit | a9636a70389246a85c2df15cd0e1e441641c785a (patch) | |
| tree | 120ff8172b3c74f21a393ad386932218f0035e8e | |
| parent | cd1ab2f94a71de0f28638570db085478852b790d (diff) | |
| download | coinos-server-a9636a70389246a85c2df15cd0e1e441641c785a.tar.gz coinos-server-a9636a70389246a85c2df15cd0e1e441641c785a.zip | |
Don't rely on short-circuit logical operators
| -rw-r--r-- | app.coffee | 9 | ||||
| -rw-r--r-- | views/main/about.html | 5 |
2 files changed, 6 insertions, 8 deletions
@@ -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 @@ </p> <p> - Transactions between bitcoin addresses are + New addresses start with a zero balance. Transactions between addresses are recorded in a public file and <a href="http://blockchain.info/unconfirmed-transactions">published on - the Internet</a>. The file keeps track of the balance of every - address. New addresses start with a zero balance. + the Internet</a>. Copies of the file are distributed over the bitcoin network which keeps track of the balance at every address. </p> <p> |
