replace underscore with our own
we only need like 5 simple functions
This commit is contained in:
@@ -103,7 +103,7 @@ const appPasswords = require('./apppasswords.js'),
|
||||
superagent = require('superagent'),
|
||||
util = require('util'),
|
||||
validator = require('validator'),
|
||||
_ = require('underscore');
|
||||
_ = require('./underscore.js');
|
||||
|
||||
const CRYPTO_SALT_SIZE = 64; // 512-bit salt
|
||||
const CRYPTO_ITERATIONS = 10000; // iterations
|
||||
@@ -191,7 +191,9 @@ function validatePassword(password) {
|
||||
|
||||
// remove all fields that should never be sent out via REST API
|
||||
function removePrivateFields(user) {
|
||||
const result = _.pick(user, 'id', 'username', 'email', 'fallbackEmail', 'displayName', 'groupIds', 'active', 'source', 'role', 'createdAt', 'twoFactorAuthenticationEnabled', 'notificationConfig');
|
||||
const result = _.pick(user, [
|
||||
'id', 'username', 'email', 'fallbackEmail', 'displayName', 'groupIds', 'active', 'source', 'role', 'createdAt',
|
||||
'twoFactorAuthenticationEnabled', 'notificationConfig']);
|
||||
|
||||
// invite status indicator
|
||||
result.inviteAccepted = !user.inviteToken;
|
||||
@@ -596,8 +598,6 @@ async function update(user, data, auditSource) {
|
||||
|
||||
if (constants.DEMO && user.username === constants.DEMO_USERNAME) throw new BoxError(BoxError.BAD_STATE, 'Not allowed in demo mode');
|
||||
|
||||
if (_.isEmpty(data)) return;
|
||||
|
||||
if (data.username) {
|
||||
// regardless of "account setup", username cannot be changed because admin could have logged in with temp password and apps
|
||||
// already know about it
|
||||
|
||||
Reference in New Issue
Block a user