From 96dda59fa0450fab5419b7833af19349253b8183 Mon Sep 17 00:00:00 2001 From: Eric Knibbe Date: Wed, 11 Oct 2017 14:20:03 -0400 Subject: [PATCH] also check "cn" attribute for display name LDAP queries to Open Directory on macOS Server don't include a "displayName" attribute, but the first name + surname combo is available in the "cn" attribute. --- server/models/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/models/user.js b/server/models/user.js index be3ab360..18b2e429 100644 --- a/server/models/user.js +++ b/server/models/user.js @@ -71,7 +71,7 @@ userSchema.statics.processProfile = (profile) => { email: primaryEmail, provider: profile.provider, providerId: profile.id, - name: profile.displayName || _.split(primaryEmail, '@')[0] + name: profile.displayName || profile.cn || _.split(primaryEmail, '@')[0] }, { new: true }).then((user) => {