$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 ) {