aboutsummaryrefslogtreecommitdiffstats
path: root/mutations.js
diff options
context:
space:
mode:
Diffstat (limited to 'mutations.js')
-rw-r--r--mutations.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/mutations.js b/mutations.js
index 57332b7d..1d716e78 100644
--- a/mutations.js
+++ b/mutations.js
@@ -1,3 +1,4 @@
+import bcrypt from 'bcrypt'
import { resolver, defaultArgs, defaultListArgs, attributeFields } from 'graphql-sequelize'
import {
graphql,
@@ -31,6 +32,7 @@ module.exports = (db, gqltypes, lnrpc) => {
},
resolve: async (root, { user }) => {
user.address = (await lnrpc.newAddress({ type: 1 }, lnrpc.meta)).address
+ user.password = await bcrypt.hash(user.password, 1)
return db['User'].create(user)
}
},