This is how I do it in CakePHP 4.1:
$user = $this->request->getAttribute('identity');
Then, you can access any of the user table fields with $user->FIELDNAME, for example, $user->email
This is how I do it in CakePHP 4.1:
$user = $this->request->getAttribute('identity');
Then, you can access any of the user table fields with $user->FIELDNAME, for example, $user->email