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

View File

@@ -159,7 +159,12 @@ function validatePassword(password) {
// remove all fields that should never be sent out via REST API
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