Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/301163

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, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/63/301163/1

diff --git a/auth/TOTPSecondaryAuthenticationProvider.php 
b/auth/TOTPSecondaryAuthenticationProvider.php
index 2ca930a..8c81000 100644
--- a/auth/TOTPSecondaryAuthenticationProvider.php
+++ b/auth/TOTPSecondaryAuthenticationProvider.php
@@ -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: newchange
Gerrit-Change-Id: I7cc3333c3e166295e85e91c7b377e53842bdb307
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

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

Reply via email to