I have a User entity that’s exposing the password field even when set to hidden:
class User extends Entity implements IdentityInterface
{protected array $_accessible = [ 'email' => true, 'picture' => true ]; protected array $_hidden = ['password'];
The call to grab the user is:
$user = $this->Users->findById($this->request->getSession()->read(‘identity.user.id’), contain: [‘Roles’])->first();
That’s it. No idea why it’s being exposed.