From edfc2f68a4974aa509ee8fe2eb833756dce24131 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 23 Aug 2022 16:56:40 -0600 Subject: [PATCH] Fix pre-auth properties in user list --- core/client_connections.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/client_connections.js b/core/client_connections.js index 157d27ae..3dbf0e45 100644 --- a/core/client_connections.js +++ b/core/client_connections.js @@ -85,13 +85,15 @@ function getActiveConnectionList( // // There may be a connection, but not a logged in user as of yet // - if (ac.user.isAuthenticated()) { - entry.text = ac.user.username; - entry.userName = ac.user.username; - entry.realName = ac.user.properties[UserProps.RealName]; - entry.location = ac.user.properties[UserProps.Location]; - entry.affils = entry.affiliation = ac.user.properties[UserProps.Affiliations]; + entry.text = ac.user?.username || 'N/A'; + entry.userName = ac.user?.username || 'N/A'; + entry.realName = ac.user?.getProperty(UserProps.RealName) || 'N/A'; + entry.location = ac.user?.getProperty(UserProps.Location) || 'N/A'; + entry.affils = entry.affiliation = + ac.user?.getProperty(UserProps.Affiliations) || 'N/A'; + if (ac.user.isAuthenticated()) { + // :TODO: track pre-auth time so we can properly track this const diff = now.diff( moment(ac.user.properties[UserProps.LastLoginTs]), 'minutes'