aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/routes/transactions.coffee4
-rw-r--r--src/routes/users.coffee2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/routes/transactions.coffee b/src/routes/transactions.coffee
index 4578a7d8..25ccbbc9 100644
--- a/src/routes/transactions.coffee
+++ b/src/routes/transactions.coffee
@@ -15,6 +15,10 @@ module.exports =
r = 'transactions': []
db.lrange("#{user}:transactions", 0, -1, (err, transactions) ->
+ if err or not transactions.length
+ res.write(JSON.stringify(r))
+ return res.end()
+
txid = ->
x = transactions[i++]
return x if x.match(/[a-z]/i)
diff --git a/src/routes/users.coffee b/src/routes/users.coffee
index 307f7ab6..838ef631 100644
--- a/src/routes/users.coffee
+++ b/src/routes/users.coffee
@@ -88,7 +88,7 @@ module.exports = (sessions) ->
db.set("token:#{token}", req.body.username)
host = req.hostname
host += ':3000' if host is 'localhost'
- url = "#{req.protocol}://#{req.hostname}:3000/verify/#{token}"
+ url = "#{req.protocol}://#{host}/verify/#{token}"
res.render('users/welcome',
user: req.params.user,