Fix user signup when profile is locked and add tests
This commit is contained in:
10
src/users.js
10
src/users.js
@@ -782,9 +782,15 @@ async function setupAccount(user, data, auditSource) {
|
||||
assert(auditSource && typeof auditSource === 'object');
|
||||
|
||||
const directoryConfig = await settings.getDirectoryConfig();
|
||||
if (directoryConfig.lockUserProfiles) return;
|
||||
|
||||
await update(user, { username: data.username, displayName: data.displayName, inviteToken: '' }, auditSource);
|
||||
var tmp = { inviteToken: '' };
|
||||
|
||||
if (!directoryConfig.lockUserProfiles) {
|
||||
tmp.username = data.username;
|
||||
tmp.displayName = data.displayName;
|
||||
}
|
||||
|
||||
await update(user, tmp, auditSource);
|
||||
|
||||
await setPassword(user, data.password, auditSource);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user