LM-Commons / LmcUser

A generic user registration and authentication module for Laminas. Supports Laminas\Db and Doctrine2. (Formerly ZfcUser)
BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

Provide the ability to add custom processing to the User Controller actions #82

Open visto9259 opened 3 months ago

visto9259 commented 3 months ago

Provide the ability to add custom processing to the User Controller actions. This will make the user controller actions extensible with additional custom processing.

For example, the User Controller Index action currently only returns a View Model with no params. The user model in the client application could be more extensive with data outside of LmcUser. The index action could allow further processing like gathering more parameters for the view template to consume, attach child views to the main view, etc.

The proposed approach is to compose an event within the constroller action and have listeners to the event to perform more processing. If the result of the events is a response, then return the response, otherwise return the view model.

For each User Controller actions, there would be the following events:

This could be used to facilitate MFA login actions where a listener would listen to a 'login.post' and perform further processing if MFA is enabled.