aboutsummaryrefslogtreecommitdiffstats
path: root/users.js
diff options
context:
space:
mode:
Diffstat (limited to 'users.js')
-rw-r--r--users.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/users.js b/users.js
index 4d90eeac..55d70821 100644
--- a/users.js
+++ b/users.js
@@ -141,15 +141,19 @@ module.exports = (addresses, auth, app, bc, db, emit) => {
user.username = username;
}
- user.currency = currency;
user.currencies = currencies;
+ user.currency = currency;
+ if (currencies.length) {
+ if(!currencies.includes(currency)) user.currency = currencies[0];
+ } else {
+ user.currency = null;
+ }
+
user.email = email;
user.phone = phone;
user.twofa = twofa;
user.pin = pin;
- console.log(user.currencies);
-
if (password && password === passconfirm) {
user.password = await bcrypt.hash(password, 1);
}