OATHUserRepository: Stop handling legacy single-key

Migration is handled by UpdateTables::switchTOTPToMultipleKeys()

The transition has been completed at WMF as well.

Bug: T304375
Change-Id: I0e6d30075dfbd66d692cd8a5e3f7c9ebf44bc065
This commit is contained in:
Reedy 2022-03-26 09:44:50 +00:00
parent 1ee5f486d6
commit 6898d6ba93

View file

@ -95,11 +95,7 @@ class OATHUserRepository {
$oathUser->setModule( $module );
$decodedData = FormatJson::decode( $res->data, true );
if ( !isset( $decodedData['keys'] ) && $module->getName() === 'totp' ) {
// Legacy single-key setup
$key = $module->newKey( $decodedData );
$oathUser->addKey( $key );
} elseif ( is_array( $decodedData['keys'] ) ) {
if ( is_array( $decodedData['keys'] ) ) {
foreach ( $decodedData['keys'] as $keyData ) {
$key = $module->newKey( $keyData );
$oathUser->addKey( $key );