diff --git a/modules/os2web_audit_entity/os2web_audit_entity.module b/modules/os2web_audit_entity/os2web_audit_entity.module index 31e291f..796bfc0 100644 --- a/modules/os2web_audit_entity/os2web_audit_entity.module +++ b/modules/os2web_audit_entity/os2web_audit_entity.module @@ -125,12 +125,7 @@ function os2web_audit_entity_log(string $message): void { // Detect user type. $account = \Drupal::currentUser(); - $apiUser = FALSE; - if (os2web_audit_entity_is_api_user($account)) { - $apiUser = TRUE; - } - $metadata['userId'] = $account->getEmail(); - $metadata['userType'] = $apiUser ? 'api' : 'web'; + $metadata['userType'] = os2web_audit_entity_is_api_user($account) ? 'api' : 'web'; $logger->info('Entity', $message, FALSE, $metadata); }