Fix disabling two-factor authentication

Fixes 97abce5.

Bug: T354505
Change-Id: Ifde7434a6c02e2f8d9d790834b7f316d4afa205a
This commit is contained in:
Taavi Väänänen 2024-01-07 22:01:28 +02:00
parent 7c46714b31
commit caf64f75ca
No known key found for this signature in database
GPG key ID: EF242F709F912FBE

View file

@ -242,6 +242,11 @@ class OATHUserRepository implements LoggerAwareInterface {
->caller( __METHOD__ )
->execute();
// TODO: figure this out from the key itself
// After calling ->disable(), getModule() will return null so this
// has to be done before.
$keyType = $user->getModule()->getName();
$user->disable();
$userName = $user->getUser()->getName();
@ -250,7 +255,7 @@ class OATHUserRepository implements LoggerAwareInterface {
$this->logger->info( 'OATHAuth disabled for {user} from {clientip}', [
'user' => $userName,
'clientip' => $clientInfo,
'oathtype' => $user->getModule()->getName(),
'oathtype' => $keyType,
] );
Manager::notifyDisabled( $user, $self );