Skip to content

Commit e4f2623

Browse files
committed
Update AuthRequestService to include accepted status organizations in user event logging. Adjusted LogUserEventAsync method and corresponding unit tests to reflect the new parameter.
1 parent 8d1d26b commit e4f2623

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/Core/Auth/Services/Implementations/AuthRequestService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public async Task<AuthRequest> CreateAuthRequestAsync(AuthRequestCreateRequestMo
129129

130130
Debug.Assert(user is not null, "user should have been validated to be non-null and thrown if it's not.");
131131
// A user event will automatically create logs for each organization/provider this user belongs to.
132-
await _eventService.LogUserEventAsync(user.Id, EventType.User_RequestedDeviceApproval);
132+
await _eventService.LogUserEventAsync(user.Id, EventType.User_RequestedDeviceApproval, includeAcceptedStatusOrgs: true);
133133

134134
AuthRequest? firstAuthRequest = null;
135135
foreach (var organizationUser in organizationUsers)

test/Core.Test/Auth/Services/AuthRequestServiceTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ await sutProvider.GetDependency<IAuthRequestRepository>()
375375

376376
await sutProvider.GetDependency<IEventService>()
377377
.Received(1)
378-
.LogUserEventAsync(user.Id, EventType.User_RequestedDeviceApproval);
378+
.LogUserEventAsync(user.Id, EventType.User_RequestedDeviceApproval,
379+
includeAcceptedStatusOrgs: true);
379380

380381
await sutProvider.GetDependency<IMailService>()
381382
.Received(1)
@@ -457,7 +458,8 @@ await sutProvider.GetDependency<IAuthRequestRepository>()
457458

458459
await sutProvider.GetDependency<IEventService>()
459460
.Received(1)
460-
.LogUserEventAsync(user.Id, EventType.User_RequestedDeviceApproval);
461+
.LogUserEventAsync(user.Id, EventType.User_RequestedDeviceApproval,
462+
includeAcceptedStatusOrgs: true);
461463

462464
await sutProvider.GetDependency<IMailService>()
463465
.Received(0)

0 commit comments

Comments
 (0)