diff options
| author | Adam Soltys <[email protected]> | 2013-01-16 00:05:18 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2013-01-16 00:05:18 -0800 |
| commit | 60f21d2927b5173ecbd9cccc8bbe91018029c471 (patch) | |
| tree | 7bd1c9e898ec7d526870d36d8c12d95cc2ddd3fa /routes | |
| parent | d78a7c4913184ad00e52839c86dc5d8b54900adf (diff) | |
| download | coinos-server-60f21d2927b5173ecbd9cccc8bbe91018029c471.tar.gz coinos-server-60f21d2927b5173ecbd9cccc8bbe91018029c471.zip | |
Test for username existence
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/users.coffee | 6 |
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'] |
