send invite status via user rest api

This commit is contained in:
Johannes Zellner
2021-10-01 14:32:37 +02:00
parent cb31e5ae8b
commit 4ce21f643e
+6 -1
View File
@@ -159,7 +159,12 @@ function validatePassword(password) {
// remove all fields that should never be sent out via REST API // remove all fields that should never be sent out via REST API
function removePrivateFields(user) { function removePrivateFields(user) {
return _.pick(user, 'id', 'username', 'email', 'fallbackEmail', 'displayName', 'groupIds', 'active', 'source', 'role', 'createdAt', 'twoFactorAuthenticationEnabled'); const result = _.pick(user, 'id', 'username', 'email', 'fallbackEmail', 'displayName', 'groupIds', 'active', 'source', 'role', 'createdAt', 'twoFactorAuthenticationEnabled');
// invite status indicator
result.inviteAccepted = !user.inviteToken;
return result;
} }
// remove all fields that Non-privileged users must not see // remove all fields that Non-privileged users must not see