Breaking: #100224 - MfaViewType migrated to backed enum

See forge#100224

Description

The class \TYPO3\CMS\Core\Authentication\Mfa\MfaViewType has been migrated to a native PHP backed enum.

Impact

Since MfaViewType is no longer a class, the existing class constants are no longer available, but are enum instances instead.

In addition, it's not possible to instantiate the class anymore or call the equals() method.

The \TYPO3\CMS\Core\Authentication\Mfa\MfaProviderInterface, which all MFA providers need to implement, does now require the third argument $type of the handleRequest() method to be a MfaViewType instead of a string.

Affected installations

All installations directly using the class constants, instantiating the class or calling the equals() method.

All extensions with custom MFA providers, which therefore implement the handleRequest() method.

Migration

To access the string representation of a MfaViewType, use the corresponding value property, e.g. \TYPO3\CMS\Core\Authentication\Mfa\MfaViewType::SETUP->value or on a variable, use $type->value.

Replace class instantiation by \TYPO3\CMS\Core\Authentication\Mfa\MfaViewType::tryFrom('setup').

Adjust your MFA providers handleRequest() method to match the interface:

public function handleRequest(
    ServerRequestInterface $request,
    MfaProviderPropertyManager $propertyManager,
    MfaViewType $type
): ResponseInterface;
Copied!