Skip to content

Conversation

@Brano5
Copy link
Collaborator

@Brano5 Brano5 commented Jan 8, 2026

This pull request enhances the IdentityComponentsEndpointRouteBuilderExtensions by introducing a customizable login handler that can be invoked after successful user authentication. This allows consumers of the API to execute custom logic (such as logging or auditing) whenever a user logs in. The most important changes are as follows:

Custom Login Handler Integration:

  • Added a LoginHandler delegate type that accepts username, group, and a list of roles, and can be optionally passed to MapAdditionalIdentityEndpoints. This enables extensibility for post-login actions.
  • Modified the signature of MapAdditionalIdentityEndpoints to accept an optional loginHandler parameter.

Login Handler Invocation:

  • After successful login via password or registration, the code now checks for the presence of the loginHandler and invokes it with the current user's details and roles. This ensures any custom logic is executed after authentication. [1] [2]
  • Injected UserManager<User> into the login endpoint to fetch user details and roles required by the login handler. [1] [2]

These changes provide a flexible hook for extending login behavior without modifying the core authentication flow.

@Brano5 Brano5 requested review from PTKu and kuh0005 January 8, 2026 05:32
@Brano5 Brano5 self-assigned this Jan 8, 2026
@PTKu PTKu merged commit 47802d9 into dev Jan 8, 2026
1 check passed
@PTKu PTKu deleted the loginDelegate branch January 8, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants