Skip to content

Commit

Permalink
[BUGFIX] Generate proper hash for v13 in LoginFormViewHelper
Browse files Browse the repository at this point in the history
Resolves: #798
  • Loading branch information
twoldanski committed Jan 24, 2025
1 parent eaf2010 commit e46d3d6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Classes/ViewHelpers/LoginFormViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
use TYPO3\CMS\Core\Security\RequestToken;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject;

use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;

use TYPO3\CMS\Extbase\Security\HashScope;
use TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper;

use function base64_encode;
Expand Down Expand Up @@ -183,11 +182,17 @@ protected function renderHiddenReferrerFields(): string
);
$this->addHiddenField(
'__referrer[arguments]',
$this->hashService->appendHmac(base64_encode(serialize($request->getArguments())))
$this->hashService->appendHmac(
base64_encode(serialize($request->getArguments())),
class_exists(\TYPO3\CMS\Form\Security\HashScope::class) ? HashScope::ReferringArguments->prefix() : ''
)
);
$this->addHiddenField(
'__referrer[@request]',
$this->hashService->appendHmac(json_encode($actionRequest))
$this->hashService->appendHmac(
json_encode($actionRequest),
class_exists(\TYPO3\CMS\Form\Security\HashScope::class) ? HashScope::ReferringRequest->prefix() : ''
)
);

return '';
Expand Down

0 comments on commit e46d3d6

Please sign in to comment.