Issue Bug Closed

#100704FrontEnd MfaProviderPropertyManager storeProperties fails if no logger available

Frank Buijze 04/21/23, 12:22 updated 08/02/24, 17:21

Description

I’m using the Typo3 providers for TOTP in frontend.

MfaProviderPropertyManager function storeProperties fails in frontend without logger. Data is stored!

 protected function storeProperties(): bool
    {
        // encode the mfa properties to store them in the database and the user array
        $mfa = json_encode($this->mfa, JSON_THROW_ON_ERROR) ?: '';

        // Write back the updated mfa properties to the user array
        $this->user->user[self::DATABASE_FIELD_NAME] = $mfa;

        // Log MFA update
        $this->logger->debug('MFA properties updated', [
            'provider' => $this->providerIdentifier,
            'user' => [
                'uid' => $this->user->user[$this->user->userid_column],
                'username' => $this->user->user[$this->user->username_column],
            ],
        ]);

        // Store updated mfa properties in the database
        return (bool)GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->user->user_table)->update(
            $this->user->user_table,
            [self::DATABASE_FIELD_NAME => $mfa],
            [$this->user->userid_column => (int)$this->user->user[$this->user->userid_column]],
            [self::DATABASE_FIELD_NAME => Connection::PARAM_LOB]
        );
    }

Failure near //Log MFA update

Both typo3 11 and 12

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.