|
|
|
@ -486,8 +486,8 @@ secureRoutes.get('/tokenRefresh', function (req, res) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
secureRoutes.get('/', function (req, res) {
|
|
|
|
|
global.mysql.query("SELECT payout_threshold FROM users WHERE id = ?", [req.decoded.id]).then(function(row){
|
|
|
|
|
return res.json({msg: row[0].payout_threshold});
|
|
|
|
|
global.mysql.query("SELECT payout_threshold, enable_email FROM users WHERE id = ?", [req.decoded.id]).then(function(row){
|
|
|
|
|
return res.json({msg: {payout_threshold: row[0].payout_threshold, email_enabled: row[0].enable_email}});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -498,6 +498,12 @@ secureRoutes.post('/changePassword', function (req, res) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
secureRoutes.post('/toggleEmail', function (req, res) {
|
|
|
|
|
global.mysql.query("UPDATE users SET enable_email = NOT enable_email WHERE id = ?", [hmac, req.decoded.id]).then(function () {
|
|
|
|
|
return res.json({'msg': 'Email toggled'});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
secureRoutes.post('/changePayoutThreshold', function (req, res) {
|
|
|
|
|
let threshold = req.body.threshold;
|
|
|
|
|
if (threshold < global.config.payout.walletMin) {
|
|
|
|
|