AuthX extension: user_load() deprecated in Drupal 8.x.
Overview
The AuthX extension is not usable with Drupal 9 since user_load() is deprecated in Drupal 8.x and removed in 9.x.
Reproduction steps
- Enable AuthX extension.
- Send HTTP request with username/password .
Current behaviour
Fails with
Error: Call to undefined function Civi\Authx\user_load() in Civi\Authx\Drupal8->loginStateless()
Expected behaviour
User is loaded without errors.
Environment information
- CiviCRM: 5.37.2
- CMS: Drupal 9.1.9
Comments
user_load() needs to be replaced with \Drupal\user\Entity\User::load().