Saeven / zf3-circlical-user

Turnkey Authentication, Identity, and RBAC for Laminas and Zend Framework 3. Supports Doctrine and Middleware.
Mozilla Public License 2.0
36 stars 15 forks source link

AccessService shouldn't assume that the created user, should be automatically logged in. #15

Closed Tigerman55 closed 7 years ago

Tigerman55 commented 8 years ago

I noticed in the authenticationService.php file, the create method automatically logs you into the new user's account. I thought it would be nice to have the option to disable this feature because that way if you are logged in as an admin and are creating users it does not log you out of the main account which would force you to log out and back in again.

https://github.com/Saeven/zf3-circlical-user/blob/master/src/CirclicalUser/Service/AuthenticationService.php#L476

I was thinking something could be done for this by either adding an additional argument to the create method or by adding an option in the circlical.user.local.php file. I'm not sure which one would be preferable.

Let me know what you think!

Saeven commented 8 years ago

Great idea, I hadn't considered that use case, but agreed -- it'll probably be very common. Feel free to PR, I can otherwise add tests and do it tonight.

Thanks!

Tigerman55 commented 8 years ago

Done. First PR. :)