Track When An Admin Logs In As Another User
Core Unlocked Package Changes
Closed #396 by adding new fields & logic to determine if the current user (stored in Log__c.LoggedBy__c
) is being impersonated by another user
-
Added config & code to track impersonators using the Login As feature - this information is now tracked in the new field
LogEntryEvent__e.ImpersonatedById__c
andLog__c.ImpersonatedBy__c
-
Added new class
LoggerSObjectProxy
with inner classes that provide representations of problematic SObject TypesAuthSession
,LoginHistory
andNetwork
. This simplifies some of the downstream code, and makes things easier to test. -
Fixed an unreported
SObjectException
that would occur when logging a record ID for a template object, such asCaseComment
,CaseHistory
,AccountHistory
, etc., with the errorSystem.SObjectException: Cannot locate Apex Type for ID
Thanks to @surajp, @bussemac, @jkranz-rk, @jamessimone, and @nojanv for all of the help with this getting this new feature released!