From f355cdd3838b560d582d56afbecb4bde0c061a81 Mon Sep 17 00:00:00 2001 From: Alejandro Ibarra Date: Fri, 12 Dec 2025 06:56:44 +0100 Subject: [PATCH] Fix ArrayObject conversion in AuthenticationService --- src/Authentication/AuthenticationService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Authentication/AuthenticationService.php b/src/Authentication/AuthenticationService.php index 9cdf7ea..33b91db 100644 --- a/src/Authentication/AuthenticationService.php +++ b/src/Authentication/AuthenticationService.php @@ -17,6 +17,7 @@ use Authentication\Authenticator\Result; use Authentication\Authenticator\ResultInterface; use Authentication\Authenticator\StatelessInterface; +use Cake\Datasource\EntityInterface; use Psr\Http\Message\ServerRequestInterface; use RuntimeException; @@ -149,7 +150,10 @@ public function authenticate(ServerRequestInterface $request): ResultInterface $result = $authenticator->authenticate($request); if ($result->isValid()) { $skipTwoFactorVerify = $authenticator->getConfig('skipTwoFactorVerify'); - $userData = $result->getData()->toArray(); + $userData = $result->getData(); + if ($userData instanceof EntityInterface) { + $userData = $userData->toArray(); + } $webauthn2faChecker = $this->getWebauthn2fAuthenticationChecker(); if ($skipTwoFactorVerify !== true && $webauthn2faChecker->isRequired($userData)) { return $this->proceedToWebauthn2fa($request, $result);