Merge "Make statsd sampling rates configurable"
[lhc/web/wiklou.git] / includes / auth / ResetPasswordSecondaryAuthenticationProvider.php
index 2e51cf2..dd97830 100644 (file)
@@ -95,12 +95,12 @@ class ResetPasswordSecondaryAuthenticationProvider extends AbstractSecondaryAuth
                        }
                }
 
-               if ( isset( $data->req ) ) {
-                       $needReq = $data->req;
-               } else {
-                       $needReq = new PasswordAuthenticationRequest();
+               $needReq = isset( $data->req ) ? $data->req : new PasswordAuthenticationRequest();
+               if ( !$needReq->action ) {
                        $needReq->action = AuthManager::ACTION_CHANGE;
                }
+               $needReq->required = $data->hard ? AuthenticationRequest::REQUIRED
+                       : AuthenticationRequest::OPTIONAL;
                $needReqs = [ $needReq ];
                if ( !$data->hard ) {
                        $needReqs[] = new ButtonAuthenticationRequest(