Problem/Motivation
The route user.page (path = /user) exists as a distinct route from entity.user.canonical (path = /user/{user}). However, once #2294571: Redirect anonymous users to login page from an exception listener instead of in MaintenanceModeSubscriber and restrict access to the my-account link to authenticated users lands, all the former route does is redirect to the latter one. That allows the "My account" link (a static link defined in user.links.menu.yml, so no current support to vary a route parameter by user) to work, but the redirect requires an extra server to browser back to server round trip.
Proposed resolution
Option 1
Make the entity.user.canonical route define the {user} parameter as optional and add something (a route enhancer?) that defaults it to the currently logged in user.
Option 2
Make the "My account" link support dynamic route parameters: #2306991: MyAccountMenuLink should dynamically adjust route parameters, not hidden property.
Remaining tasks
Pick an option and do it.
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2360971.patch | 16.29 KB | amateescu |
Comments
Comment #1
catchComment #2
catchComment #3
wim leersComment #4
amateescu commentedThis seems to work.
Comment #6
yesct commentedchanging to use the more common tag, so the less common one can be deleted, so it does not show up in the auto complete and confuse people.
Comment #15
gagarine commentedI stumble on this issue will I wanted to change the default tab when "My Account" menu link was clicked. This redirect is quiet strange.
Comment #17
derekcresswell commentedIn my opinion we need to remove but keep the ability to access this route. It is convenient to have the route
/useras it can be used in places such as a static bit of html.The redirect for this and the edit page should be converted. We can do just the first here and edit in #3168624: Add 'user/edit' route if wanted. Either way these issues are connected.