aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2013-01-16 00:05:18 -0800
committerAdam Soltys <[email protected]>2013-01-16 00:05:18 -0800
commit60f21d2927b5173ecbd9cccc8bbe91018029c471 (patch)
tree7bd1c9e898ec7d526870d36d8c12d95cc2ddd3fa /routes
parentd78a7c4913184ad00e52839c86dc5d8b54900adf (diff)
downloadcoinos-server-60f21d2927b5173ecbd9cccc8bbe91018029c471.tar.gz
coinos-server-60f21d2927b5173ecbd9cccc8bbe91018029c471.zip
Test for username existence
Diffstat (limited to 'routes')
-rw-r--r--routes/users.coffee6
1 files changed, 6 insertions, 0 deletions
diff --git a/routes/users.coffee b/routes/users.coffee
index d312dcf5..b39fc8e9 100644
--- a/routes/users.coffee
+++ b/routes/users.coffee
@@ -2,6 +2,12 @@ db = require("redis").createClient()
bcrypt = require('bcrypt')
module.exports = (sessions) ->
+ exists: (req, res) ->
+ db.hgetall(req.params.user, (err, obj) ->
+ if obj? then res.write('true') else res.write('false')
+ res.end()
+ )
+
json: (req, res) ->
db.hgetall(req.params.user, (err, obj) ->
delete obj['password']