- 🇩🇪Germany Anybody Porta Westfalica
Re #9: The information is correct, but at least since #2238561: Use the default PHP session ID instead of generating a custom one → (Change record: https://www.drupal.org/node/3006306 → )
the'id' => $this->session->getId(),
returns an empty string!
So using the services module login method returns:
{ "id": "", "name": "SSESS2a2e46d6add4bddd473123417e13ddc0067a6f" }
Adding
$this->session->save();
prior to the
return
statement restores the expected functionality.Still this isn't very helpful, I think?
Looking at the code one line below you see a maintainer comment:
// Return $this->entityManager->getStorage('user')->load($uid);
So I'm adding a MR not only to save the session and fix the empty ID, but also to return the user ID of the logged in user on success.
- Status changed to Needs review
9 months ago 3:23pm 2 April 2024 - last update
9 months ago Checkout Error - 🇩🇪Germany Anybody Porta Westfalica
I just compared this to the Drupal 7 result and I think we should try to get parity, where possible and useful.
Getting the user information on login is very typical I think to show user information. If someone disagrees, we should at least allow to fetch the user information easily in a second call: ✨ Add (current) user information ServiceDefinition ActiveSo best would be maintainer feedback here to hear, if adding user details to the response is fine or this should be split off!