ZF-Commons / ZfcUser

A generic user registration and authentication module for ZF2. Supports Zend\Db and Doctrine2. (Formerly EdpUser)
BSD 3-Clause "New" or "Revised" License
495 stars 343 forks source link

UserControllerFactory over-eager loading of all forms from factories #643

Open nclundsten opened 8 years ago

nclundsten commented 8 years ago

https://github.com/ZF-Commons/ZfcUser/blob/1.4.3/src/ZfcUser/Factory/Controller/UserControllerFactory.php

seems really un-necessary to create+inject a change password form, register form, etc when someone is just logging in, same goes for other controller actions

nclundsten commented 8 years ago

if its determined that the forms should continue to be injected in the controller factory, then we could at least use lazy services -- https://framework.zend.com/manual/2.4/en/modules/zend.service-manager.lazy-services.html

hurnell commented 7 years ago

Creating (injecting) the login form in UserControllerFactory causes all flash messages to be lost! This means that when a user changes their password or e-mail address the feedback message will not be displayed. The UserController::setLoginForm method changes the namespace of the flashMessenger causing all previous messages to be lost. Remove all the form creation methods and save the overhead of creating forms that will not be needed.