diff options
| author | Adam Soltys <[email protected]> | 2015-12-03 20:24:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2015-12-03 20:24:37 -0800 |
| commit | 3de0e94e1343df0ce2cc8f39de53b1eef87b0a84 (patch) | |
| tree | cd2d4896890fa11f7c446f3ff218fbe43f3e61a1 /src | |
| parent | b5edbc724cbebb44d54ee508752cb2101a356a3d (diff) | |
| download | coinos-server-3de0e94e1343df0ce2cc8f39de53b1eef87b0a84.tar.gz coinos-server-3de0e94e1343df0ce2cc8f39de53b1eef87b0a84.zip | |
Derive BIP44 wallets from BIP39 seeds on registration, clean up wallet page
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/users.coffee | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/routes/users.coffee b/src/routes/users.coffee index f46c69cf..8ff7f17a 100644 --- a/src/routes/users.coffee +++ b/src/routes/users.coffee @@ -94,34 +94,33 @@ module.exports = (sessions) -> ) ) - if process.env.NODE_ENV is 'production' - require('crypto').randomBytes(48, (ex, buf) -> - token = buf.toString('base64').replace(/\//g,'').replace(/\+/g,'') - db.set("token:#{token}", req.body.username) - host = req.hostname - host += ':3000' if host is 'localhost' - url = "#{req.protocol}://#{host}/verify/#{token}" + require('crypto').randomBytes(48, (ex, buf) -> + token = buf.toString('base64').replace(/\//g,'').replace(/\+/g,'') + db.set("token:#{token}", req.body.username) + host = req.hostname + host += ':3000' if host is 'localhost' + url = "#{req.protocol}://#{host}/verify/#{token}" - res.render('users/welcome', - user: req.params.user, - layout: 'mail', - url: url, - privkey: req.body.privkey, - js: (-> global.js), - css: (-> global.css), - (err, html) -> - sendgrid = require('sendgrid')(config.sendgrid_user, config.sendgrid_password) + res.render('users/welcome', + user: req.params.user, + layout: 'mail', + url: url, + privkey: req.body.privkey, + js: (-> global.js), + css: (-> global.css), + (err, html) -> + sendgrid = require('sendgrid')(config.sendgrid_user, config.sendgrid_password) - email = new sendgrid.Email( - to: req.body.email - from: '[email protected]' - subject: 'Welcome to CoinOS' - html: html - ) + email = new sendgrid.Email( + to: req.body.email + from: '[email protected]' + subject: 'Welcome to CoinOS' + html: html + ) - sendgrid.send(email) - ) + sendgrid.send(email) ) + ) ) edit: (req, res) -> |
