users: rename createdAt to creationTime

This commit is contained in:
Girish Ramakrishnan
2021-05-17 07:18:21 -07:00
parent 2421536c23
commit 53dce1e7aa
4 changed files with 42 additions and 11 deletions

View File

@@ -154,7 +154,7 @@ function create(username, password, email, displayName, options, auditSource, ca
const source = options.source || ''; // empty is local user
const role = options.role || exports.ROLE_USER;
var error;
let error;
if (username !== null) {
username = username.toLowerCase();
@@ -185,15 +185,13 @@ function create(username, password, email, displayName, options, auditSource, ca
crypto.pbkdf2(password, salt, CRYPTO_ITERATIONS, CRYPTO_KEY_LENGTH, CRYPTO_DIGEST, function (error, derivedKey) {
if (error) return callback(new BoxError(BoxError.CRYPTO_ERROR, error));
var now = (new Date()).toISOString();
var user = {
const user = {
id: 'uid-' + uuid.v4(),
username: username,
email: email,
fallbackEmail: email,
password: Buffer.from(derivedKey, 'binary').toString('hex'),
salt: salt.toString('hex'),
createdAt: now,
resetToken: '',
displayName: displayName,
source: source,