Code Duplication    Length = 7-7 lines in 2 locations

lib/Controller/DocumentController.php 2 locations

@@ 349-355 (lines=7) @@
346
		try {
347
			$share = $this->shareManager->getShareByToken($shareToken);
348
			// not authenticated ?
349
			if($share->getPassword()){
350
				if (!$this->session->exists('public_link_authenticated')
351
					|| $this->session->get('public_link_authenticated') !== (string)$share->getId()
352
				) {
353
					throw new \Exception('Invalid password');
354
				}
355
			}
356
357
			$node = $share->getNode();
358
			if($node instanceof Folder) {
@@ 412-418 (lines=7) @@
409
		try {
410
			$share = $this->shareManager->getShareByToken($shareToken);
411
			// not authenticated ?
412
			if($share->getPassword()){
413
				if (!$this->session->exists('public_link_authenticated')
414
					|| $this->session->get('public_link_authenticated') !== (string)$share->getId()
415
				) {
416
					throw new \Exception('Invalid password');
417
				}
418
			}
419
420
			$node = $share->getNode();
421
			if ($filePath !== null) {