Browse Source

code review

pull/4023/head
Martin McKeaveney 6 years ago
parent
commit
ccb6b59588
  1. 3
      packages/server/src/api/controllers/user.js
  2. 2
      packages/server/src/api/routes/tests/couchTestUtils.js

3
packages/server/src/api/controllers/user.js

@ -20,7 +20,7 @@ exports.fetch = async function(ctx) {
exports.create = async function(ctx) {
const db = new CouchDB(ctx.user.appId)
const { email, password, name, accessLevelId, permissions } = ctx.request.body
const { email, password, accessLevelId, permissions } = ctx.request.body
if (!email || !password) {
ctx.throw(400, "email and Password Required.")
@ -34,7 +34,6 @@ exports.create = async function(ctx) {
_id: generateUserID(email),
email,
password: await bcrypt.hash(password),
name,
type: "user",
accessLevelId,
permissions: permissions || [BUILTIN_PERMISSION_NAMES.POWER],

2
packages/server/src/api/routes/tests/couchTestUtils.js

@ -118,7 +118,7 @@ exports.clearApplications = async request => {
exports.createUser = async (
request,
appId,
email = "babs",
email = "babs@babs.com",
password = "babs_password"
) => {
const res = await request

Loading…
Cancel
Save