TOTPKey: Remove unused code

Change-Id: I2d171823dc4c7c88b32872a6c3521af05b10ef39
This commit is contained in:
Taavi Väänänen 2024-01-04 11:40:31 +02:00 committed by Reedy
parent f0f728d342
commit 0f026d7999

View file

@ -25,8 +25,8 @@ use EmptyBagOStuff;
use Exception; use Exception;
use jakobo\HOTP\HOTP; use jakobo\HOTP\HOTP;
use MediaWiki\Extension\OATHAuth\IAuthKey; use MediaWiki\Extension\OATHAuth\IAuthKey;
use MediaWiki\Extension\OATHAuth\OATHAuthServices;
use MediaWiki\Extension\OATHAuth\OATHUser; use MediaWiki\Extension\OATHAuth\OATHUser;
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
use MediaWiki\Logger\LoggerFactory; use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use MWException; use MWException;
@ -189,11 +189,7 @@ class TOTPKey implements IAuthKey {
'clientip' => $clientIP, 'clientip' => $clientIP,
] ); ] );
$moduleRegistry = MediaWikiServices::getInstance()->getService( 'OATHAuthModuleRegistry' ); $userRepo = OATHAuthServices::getInstance()->getUserRepository();
$module = $moduleRegistry->getModuleByKey( 'totp' );
/** @var OATHUserRepository $userRepo */
$userRepo = MediaWikiServices::getInstance()->getService( 'OATHUserRepository' );
// TODO: support for multiple keys // TODO: support for multiple keys
$user->setKeys( [ $this ] ); $user->setKeys( [ $this ] );
$userRepo->persist( $user, $clientIP ); $userRepo->persist( $user, $clientIP );