Add (current) user information ServiceDefinition

Created on 2 April 2024, 9 months ago

Problem/Motivation

In Drupal 7 there was a "system.connect" resource to retrieve information about the currently logged in user:
system > connect
Returns the details of currently logged in user.

This seems to be entirely missing in Drupal 8+ (5.x)?

As a follow-up on When authenticating via endpoint/user/login the user object or uid should be returned Needs review it would make sense to retrieve information about the currently logged in user, as the login won't return such, presumably!

As a workaround, you could use the uid returned from the login, but then you'd have to store it and the DX isn't really nice with the uid requirement.

Steps to reproduce

Try to get information out the currently logged in user.

Proposed resolution

Like the additional User > UserLogin / UserLogout Service Definitions add a UserInformation (or something like that) service definition plugin, which returns information about the currently logged in user without requiring the uid parameter.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

5.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024