Skip to content

Commit

Permalink
fix: fix wrong display-name property from provisioning getUser response
Browse files Browse the repository at this point in the history
- Fix: #70
- Related: nextcloud/server#36665

Signed-off-by: Grigorii Shartsev <grigorii.shartsev@nextcloud.com>
  • Loading branch information
ShGKme committed Mar 22, 2023
1 parent 91cda75 commit ba2a2f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/patchers/nextcloud-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export {
export function getCurrentUser() {
return {
uid: appData.userMetadata.id,
displayName: appData.userMetadata.displayname,
isAdmin: appData.userMetadata.groups.includes('admin'), // TODO: Is it true way to detect admin?
// Current user metadata had different property name for display name than userMetadata
// @see https://github.com/nextcloud/server/pull/36665
displayName: appData.userMetadata.displayname ?? appData.userMetadata['display-name'],
isAdmin: appData.userMetadata.groups.includes('admin'),
}
}

0 comments on commit ba2a2f9

Please sign in to comment.