diff options
| author | Adam Soltys <[email protected]> | 2012-11-21 06:51:11 +0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2012-11-21 10:48:45 +0400 |
| commit | 86918fe5eee925a1a1eb0b836e177b247c0700b9 (patch) | |
| tree | 199d04a0063efd6276f1026f29947632ea30b974 | |
| parent | 0910ced9cce2d1c15858afb4e05dc16e7acab34a (diff) | |
| download | coinos-server-86918fe5eee925a1a1eb0b836e177b247c0700b9.tar.gz coinos-server-86918fe5eee925a1a1eb0b836e177b247c0700b9.zip | |
No bcrypt
| -rw-r--r-- | app.coffee | 34 |
1 files changed, 0 insertions, 34 deletions
@@ -3,7 +3,6 @@ http = require('http') path = require('path') engines = require('consolidate') passport = require('passport') -bcrypt = require('bcrypt') config = require('./config') app = express() @@ -45,14 +44,6 @@ app.get('/', (req, res) -> res.render('index', js: (-> global.js), css: (-> global.css)) ) -app.get('/bcrypt', (req, res) -> - salt = "$2a$10$3R8tUtIoU/fllQD9zEgTZe" - hash = bcrypt.hashSync("chelsea", salt) - res.write(salt + "\n") - res.write(hash) - res.end() -) - app.get('/:user/report', (req, res) -> res.render('report', user: req.params.user, @@ -128,31 +119,6 @@ app.post('/login', (req, res, next) -> )(req, res, next) ) -app.post('/users', (req, res) -> - if req.body.login - if req.body.password - bcrypt.hash(req.body.password, 12, (err, hash) -> - db = require("redis").createClient() - db.hget(req.body.login, 'password', (err, password) -> - bcrypt.compare(req.body.password, password, (err, match) -> - if match - req.body.password = password - db.hmset(req.body.login, req.body, -> - res.redirect(req.body.login) - ) - else - res.redirect(req.body.login) - ) - ) - ) - else - params = [] - for k,v of req.body - params.push(encodeURIComponent(k), '=', encodeURIComponent(v), '&') - params.pop() if (params.length) - res.redirect('calculator?' + params.join('')) -) - app.post('/:user/transactions', (req, res) -> user = req.params.user db = require("redis").createClient() |
