Code Duplication    Length = 4-4 lines in 2 locations

engine/lib/sessions.php 2 locations

@@ 180-183 (lines=4) @@
177
	if (!$hash) {
178
		// try legacy hash
179
		$legacy_hash = $password_svc->generateLegacyHash($user, $password);
180
		if ($user->password !== $legacy_hash) {
181
			log_login_failure($user->guid);
182
			throw new \LoginException(_elgg_services()->translator->translate('LoginException:PasswordFailure'));
183
		}
184
185
		// migrate password
186
		$password_svc->forcePasswordReset($user, $password);
@@ 190-193 (lines=4) @@
187
		return true;
188
	}
189
190
	if (!$password_svc->verify($password, $hash)) {
191
		log_login_failure($user->guid);
192
		throw new \LoginException(_elgg_services()->translator->translate('LoginException:PasswordFailure'));
193
	}
194
195
	if ($password_svc->needsRehash($hash)) {
196
		$password_svc->forcePasswordReset($user, $password);