Improve user management: remove audit log, fix bugs, add sessions#20
Merged
antosubash merged 5 commits intomainfrom Mar 30, 2026
Merged
Improve user management: remove audit log, fix bugs, add sessions#20antosubash merged 5 commits intomainfrom
antosubash merged 5 commits intomainfrom
Conversation
c2ffb7a to
649bacd
Compare
20cd3e8 to
6b99081
Compare
Deploying simplemodule with
|
| Latest commit: |
bb8d7bf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dce54d48.simplemodule.pages.dev |
| Branch Preview URL: | https://claude-fix-pr20-errors-4ttip.simplemodule.pages.dev |
d3fa853 to
83bb614
Compare
Deploying simplemodule-website with
|
| Latest commit: |
04c477a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://64299156.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-improve-user-manageme.simplemodule-website.pages.dev |
Remove the Admin module's custom audit logging (AuditService, AuditLogEntry, ActivityTimeline, activity tab) since the dedicated AuditLogs module now handles this automatically via HTTP middleware and entity change tracking. Bug fixes: - Add missing fields to AdminUserDto (twoFactorEnabled, accessFailedCount, lastLoginAt) that the frontend was rendering as undefined - Add password match validation on UsersCreate form - Prevent admins from locking/deactivating their own account (server + UI) - Surface validation errors on create user form via onError callback Performance: - Fix N+1 query in GetUsersPagedAsync by batch-loading roles with a single join query instead of per-user GetRolesAsync calls UX improvements: - Upgrade Users list to DataGridPage component (consistent with Roles page) - Add status filter (active/locked/deactivated) and role filter dropdowns - Show "You" badge and created date on user edit page - Show locked badge on user header when applicable
…ndancy - Replace native <select> elements with @simplemodule/ui Select components for visual consistency with the rest of the admin UI - Remove redundant goToPage function (navigate already handles it) - Remove redundant userRoles prop (derivable from user.roles) - Parallelize independent DB calls in UsersEndpoint and UsersEditEndpoint using Task.WhenAll for lower latency on page loads - Collapse sequential Identity writes (Lock/Unlock/Deactivate/Reactivate) into single UpdateAsync calls to reduce round-trips
Add a Sessions tab to the user edit page that shows active OpenIddict tokens (access and refresh) for the user, with ability to revoke individual sessions or all sessions at once. Architecture: - IOpenIddictSessionContracts + UserSessionDto in OpenIddict.Contracts - OpenIddictSessionService queries tokens via IOpenIddictTokenManager - AdminSessionsEndpoint provides DELETE routes for revocation - UsersEditEndpoint fetches sessions in parallel with other data The session service filters to valid, non-expired tokens, caches application name lookups, and uses OpenIddict's TryRevokeAsync for proper revocation.
83bb614 to
3ea7826
Compare
AdminDbContext was deleted when removing the custom audit log from the Admin module, but the test fixture still referenced it for SQLite replacement and database initialization.
3ea7826 to
e5fa4e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
twoFactorEnabled,accessFailedCount,lastLoginAt) that the frontend rendered as undefinedonErrorcallbackGetUsersPagedAsyncby batch-loading roles with a single joinDataGridPagewith status and role filter dropdowns using design systemSelectcomponentsUsersEndpointandUsersEditEndpointviaTask.WhenAllUpdateAsynccallsTest plan
dotnet test— all tests passnpm run check— lint passes