Problem/Motivation
#2288911: Use route name instead of system path in user maintenance mode subscriber introduces an exception subscriber (AccessDeniedSubscriber
) to redirect authenticated users from user/login
and user/register
to the users profile page and profile form respectively. Let's also remove the redirection of anonymous users from user
to user/login
from the maintenance mode subscriber to the UserController::userPage
. In order to do this it is necessary to change quite a bit of test code which assumes a login form on the user
page instead of at user/login
.
Proposed resolution
Move the redirection of anonymous users from user
to user/login
into an exception listener and restrict access to user
to authenticated users. Also fix tests where necessary.
Note that before anonymous users only are redirected from user
to user/login
when maintenance mode was active. With this patch this will happen even when maintenance mode is not active. This will also resolve an obscure theming issue which is exclusive to the login page #2346671: Two templates necessary in order to customize the login page.