aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2015-12-03 20:24:37 -0800
committerAdam Soltys <[email protected]>2015-12-03 20:24:37 -0800
commit3de0e94e1343df0ce2cc8f39de53b1eef87b0a84 (patch)
treecd2d4896890fa11f7c446f3ff218fbe43f3e61a1 /routes
parentb5edbc724cbebb44d54ee508752cb2101a356a3d (diff)
downloadcoinos-server-3de0e94e1343df0ce2cc8f39de53b1eef87b0a84.tar.gz
coinos-server-3de0e94e1343df0ce2cc8f39de53b1eef87b0a84.zip
Derive BIP44 wallets from BIP39 seeds on registration, clean up wallet page
Diffstat (limited to 'routes')
-rw-r--r--routes/users.js62
1 files changed, 30 insertions, 32 deletions
diff --git a/routes/users.js b/routes/users.js
index 9dc9c801..5348ee67 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -128,40 +128,38 @@
return sessions.create(req, res);
});
});
- if (process.env.NODE_ENV === 'production') {
- return require('crypto').randomBytes(48, function(ex, buf) {
- var host, token, url;
- token = buf.toString('base64').replace(/\//g, '').replace(/\+/g, '');
- db.set("token:" + token, req.body.username);
- host = req.hostname;
- if (host === 'localhost') {
- host += ':3000';
- }
- url = "" + req.protocol + "://" + host + "/verify/" + token;
- return res.render('users/welcome', {
- user: req.params.user,
- layout: 'mail',
- url: url,
- privkey: req.body.privkey,
- js: (function() {
- return global.js;
- }),
- css: (function() {
- return global.css;
- })
- }, function(err, html) {
- var email, sendgrid;
- sendgrid = require('sendgrid')(config.sendgrid_user, config.sendgrid_password);
- email = new sendgrid.Email({
- to: req.body.email,
- subject: 'Welcome to CoinOS',
- html: html
- });
- return sendgrid.send(email);
+ return require('crypto').randomBytes(48, function(ex, buf) {
+ var host, token, url;
+ token = buf.toString('base64').replace(/\//g, '').replace(/\+/g, '');
+ db.set("token:" + token, req.body.username);
+ host = req.hostname;
+ if (host === 'localhost') {
+ host += ':3000';
+ }
+ url = "" + req.protocol + "://" + host + "/verify/" + token;
+ return res.render('users/welcome', {
+ user: req.params.user,
+ layout: 'mail',
+ url: url,
+ privkey: req.body.privkey,
+ js: (function() {
+ return global.js;
+ }),
+ css: (function() {
+ return global.css;
+ })
+ }, function(err, html) {
+ var email, sendgrid;
+ sendgrid = require('sendgrid')(config.sendgrid_user, config.sendgrid_password);
+ email = new sendgrid.Email({
+ to: req.body.email,
+ subject: 'Welcome to CoinOS',
+ html: html
});
+ return sendgrid.send(email);
});
- }
+ });
});
},
edit: function(req, res) {