@@ -94,11 +94,11 @@ private function getAuditStrategy($em): ?IAuditStrategy
9494 private function buildAuditContext (): AuditContext
9595 {
9696 $ resourceCtx = app (IResourceServerContext::class);
97- $ userExternalId = $ resourceCtx ->getCurrentUserId ();
98- $ member = null ;
99- if ($ userExternalId ) {
100- $ memberRepo = app (IUserRepository::class);
101- $ member = $ memberRepo -> findOneBy ([ " external_id " => $ userExternalId ] );
97+ $ userId = $ resourceCtx ->getCurrentUserId ();
98+ $ user = null ;
99+ if ($ userId ) {
100+ $ userRepo = app (IUserRepository::class);
101+ $ user = $ userRepo -> find ( $ userId );
102102 }
103103
104104 //$ui = app()->bound('ui.context') ? app('ui.context') : [];
@@ -117,10 +117,10 @@ private function buildAuditContext(): AuditContext
117117 }
118118
119119 return new AuditContext (
120- userId: $ member ?->getId() ,
121- userEmail: $ member ?->getEmail(),
122- userFirstName: $ member ?->getFirstName(),
123- userLastName: $ member ?->getLastName(),
120+ userId: $ userId ,
121+ userEmail: $ user ?->getEmail(),
122+ userFirstName: $ user ?->getFirstName(),
123+ userLastName: $ user ?->getLastName(),
124124 uiApp: $ ui ['app ' ] ?? null ,
125125 uiFlow: $ ui ['flow ' ] ?? null ,
126126 route: $ req ?->path(),
0 commit comments