Merge "Support the creation of special pages with services injected"
[lhc/web/wiklou.git] / includes / auth / AbstractPasswordPrimaryAuthenticationProvider.php
index 4096f19..cd9eac4 100644 (file)
@@ -121,10 +121,14 @@ abstract class AbstractPasswordPrimaryAuthenticationProvider
                $reset = $this->getPasswordResetData( $username, $data );
 
                if ( !$reset && $this->config->get( 'InvalidPasswordReset' ) && !$status->isGood() ) {
-                       $reset = (object)[
-                               'msg' => $status->getMessage( 'resetpass-validity-soft' ),
-                               'hard' => false,
-                       ];
+                       $hard = $status->getValue()['forceChange'] ?? false;
+
+                       if ( $hard || !empty( $status->getValue()['suggestChangeOnLogin'] ) ) {
+                               $reset = (object)[
+                                       'msg' => $status->getMessage( $hard ? 'resetpass-validity' : 'resetpass-validity-soft' ),
+                                       'hard' => $hard,
+                               ];
+                       }
                }
 
                if ( $reset ) {