49 case AuthManager::ACTION_LOGIN:
67 $authUser = $userRepo->findByUser( $user );
69 if ( !( $authUser->getModule() instanceof
TOTP ) ) {
70 return AuthenticationResponse::newAbstain();
73 wfMessage(
'oathauth-auth-ui' ),
'warning' );
83 $request = AuthenticationRequest::getRequestByClass( $reqs, TOTPAuthenticationRequest::class );
86 wfMessage(
'oathauth-login-failed' ),
'error' );
90 $authUser = $userRepo->findByUser( $user );
91 $token = $request->OATHToken;
93 if ( !( $authUser->getModule() instanceof
TOTP ) ) {
94 $this->logger->warning(
'Two-factor authentication was disabled mid-authentication for '
96 return AuthenticationResponse::newAbstain();
100 if ( $user->pingLimiter(
'badoath', 0 ) ) {
101 return AuthenticationResponse::newUI(
104 'oathauth-throttled',
110 if ( $authUser->getModule()->verify( $authUser, [
'token' => $token ] ) ) {
111 return AuthenticationResponse::newPass();
114 wfMessage(
'oathauth-login-failed' ),
'error' );
126 return AuthenticationResponse::newAbstain();
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
The Message class provides methods which fulfil two basic services:
static durationParam( $duration)
The User object encapsulates all of the user-specific settings (user_id, name, rights,...