Problem/Motivation
We are calling the procedural functions user_login_finalize()
and user_logout()
in user.module
.
However, these have a load of dependencies such as
- AccountInterface
- SessionInterface
- SessionManagerInterface
- EntityTypeManagerInterface
- ModuleHandlerInterface
- LoggerInterface
Let's create a service and do proper dependency injection.
Steps to reproduce
Proposed resolution
- create a new
\Drupal\user\UserSessionHandlerInterface
and\Drupal\user\UserSessionHandler
- define a new
'user.user_session_handler'
service - deprecate
user_login_finalize()
anduser_logout()
- replace all usages in core
Remaining tasks
User interface changes
API changes
user_login_finalize()
anduser_logout()
are deprecated- a new
'user.user_session_handler'
service is added
Data model changes
Release notes snippet
Original summary
Lets move this somewhere..maybe the User entity controller? i am not really sure cause it has to do with session