jenkins-bot has submitted this change and it was merged.

Change subject: Show the first input as a warning, not as an error box
......................................................................


Show the first input as a warning, not as an error box

The first time the extension asks for the code of the mobile phone
isn't an error and shouldn't be styles as such (see the depends-on
change). Change all other UIs to errors.

Bug: T139179
Change-Id: I7cc3333c3e166295e85e91c7b377e53842bdb307
Depends-On: I9a27911613e62b5c4cb86bea40696cb37c4f49c2
---
M auth/TOTPSecondaryAuthenticationProvider.php
1 file changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/auth/TOTPSecondaryAuthenticationProvider.php 
b/auth/TOTPSecondaryAuthenticationProvider.php
index 2ca930a..af38fbf 100644
--- a/auth/TOTPSecondaryAuthenticationProvider.php
+++ b/auth/TOTPSecondaryAuthenticationProvider.php
@@ -39,7 +39,7 @@
                        return AuthenticationResponse::newAbstain();
                } else {
                        return AuthenticationResponse::newUI( array( new 
TOTPAuthenticationRequest() ),
-                               wfMessage( 'oathauth-auth-ui' ) );
+                               wfMessage( 'oathauth-auth-ui' ), 'warning' );
                }
        }
 
@@ -52,14 +52,17 @@
                $request = AuthenticationRequest::getRequestByClass( $reqs, 
TOTPAuthenticationRequest::class );
                if ( !$request ) {
                        return AuthenticationResponse::newUI( array( new 
TOTPAuthenticationRequest() ),
-                               wfMessage( 'oathauth-login-failed' ) );
+                               wfMessage( 'oathauth-login-failed' ), 'error' );
                }
 
                $throttler = new Throttler( null, [ 'type' => 'TOTP' ] );
                $result = $throttler->increase( $user->getName(), null, 
__METHOD__ );
                if ( $result ) {
                        return AuthenticationResponse::newUI( array( new 
TOTPAuthenticationRequest() ),
-                               new Message( 'oathauth-throttled', [ 
Message::durationParam( $result['wait'] ) ] ) );
+                               new Message(
+                                       'oathauth-throttled',
+                                       [ Message::durationParam( 
$result['wait'] ) ]
+                               ), 'error' );
                }
 
                $oathuser = OATHAuthHooks::getOATHUserRepository()->findByUser( 
$user );
@@ -76,7 +79,7 @@
                        return AuthenticationResponse::newPass();
                } else {
                        return AuthenticationResponse::newUI( array( new 
TOTPAuthenticationRequest() ),
-                               wfMessage( 'oathauth-login-failed' ) );
+                               wfMessage( 'oathauth-login-failed' ), 'error' );
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/301163
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7cc3333c3e166295e85e91c7b377e53842bdb307
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to